google-api-client 0.32.1 → 0.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.kokoro/continuous/linux.cfg +2 -2
- data/.kokoro/continuous/post.cfg +30 -0
- data/.kokoro/presubmit/linux.cfg +1 -1
- data/.kokoro/release.cfg +94 -0
- data/.repo-metadata.json +5 -0
- data/.rubocop.yml +5 -0
- data/.yardopts +16 -3
- data/CHANGELOG.md +327 -0
- data/Gemfile +1 -0
- data/OVERVIEW.md +36 -0
- data/README.md +50 -2
- data/Rakefile +71 -2
- data/docs/api-keys.md +20 -0
- data/docs/auth.md +53 -0
- data/docs/client-secrets.md +69 -0
- data/docs/getting-started.md +340 -0
- data/docs/installation.md +0 -0
- data/docs/logging.md +34 -0
- data/docs/media-upload.md +25 -0
- data/docs/oauth-installed.md +191 -0
- data/docs/oauth-server.md +135 -0
- data/docs/oauth-web.md +280 -0
- data/docs/oauth.md +268 -0
- data/docs/pagination.md +29 -0
- data/docs/performance.md +25 -0
- data/generated/google/apis/accessapproval_v1beta1/classes.rb +35 -2
- data/generated/google/apis/accessapproval_v1beta1/representations.rb +13 -0
- data/generated/google/apis/accessapproval_v1beta1/service.rb +108 -6
- data/generated/google/apis/accessapproval_v1beta1.rb +1 -1
- data/generated/google/apis/accesscontextmanager_v1/classes.rb +1 -1
- data/generated/google/apis/accesscontextmanager_v1.rb +1 -1
- data/generated/google/apis/accesscontextmanager_v1beta/classes.rb +1 -73
- data/generated/google/apis/accesscontextmanager_v1beta/representations.rb +0 -32
- data/generated/google/apis/accesscontextmanager_v1beta.rb +1 -1
- data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
- data/generated/google/apis/adexchangebuyer_v1_3/classes.rb +24 -2
- data/generated/google/apis/adexchangebuyer_v1_3/representations.rb +1 -0
- data/generated/google/apis/adexchangebuyer_v1_3.rb +1 -1
- data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +25 -3
- data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +1 -0
- data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
- data/generated/google/apis/admin_datatransfer_v1/classes.rb +5 -5
- data/generated/google/apis/admin_datatransfer_v1/service.rb +2 -2
- data/generated/google/apis/admin_datatransfer_v1.rb +1 -1
- data/generated/google/apis/admin_directory_v1/classes.rb +4 -3
- data/generated/google/apis/admin_directory_v1.rb +4 -1
- data/generated/google/apis/admin_reports_v1/classes.rb +87 -44
- data/generated/google/apis/admin_reports_v1/service.rb +310 -64
- data/generated/google/apis/admin_reports_v1.rb +2 -2
- data/generated/google/apis/androidmanagement_v1.rb +1 -1
- data/generated/google/apis/androidpublisher_v3/classes.rb +105 -0
- data/generated/google/apis/androidpublisher_v3/representations.rb +51 -0
- data/generated/google/apis/androidpublisher_v3.rb +1 -1
- data/generated/google/apis/appengine_v1/service.rb +10 -6
- data/generated/google/apis/appengine_v1.rb +1 -1
- data/generated/google/apis/appengine_v1beta/service.rb +10 -6
- data/generated/google/apis/appengine_v1beta.rb +1 -1
- data/generated/google/apis/appsmarket_v2.rb +1 -1
- data/generated/google/apis/bigquery_v2/classes.rb +104 -23
- data/generated/google/apis/bigquery_v2/representations.rb +37 -0
- data/generated/google/apis/bigquery_v2/service.rb +1 -5
- data/generated/google/apis/bigquery_v2.rb +1 -1
- data/generated/google/apis/bigqueryconnection_v1beta1/classes.rb +6 -5
- data/generated/google/apis/bigqueryconnection_v1beta1/service.rb +3 -2
- data/generated/google/apis/bigqueryconnection_v1beta1.rb +1 -1
- data/generated/google/apis/bigquerydatatransfer_v1/service.rb +30 -4
- data/generated/google/apis/bigquerydatatransfer_v1.rb +1 -1
- data/generated/google/apis/bigqueryreservation_v1/classes.rb +0 -21
- data/generated/google/apis/bigqueryreservation_v1/representations.rb +0 -13
- data/generated/google/apis/bigqueryreservation_v1.rb +1 -1
- data/generated/google/apis/bigqueryreservation_v1alpha2/classes.rb +116 -1
- data/generated/google/apis/bigqueryreservation_v1alpha2/representations.rb +35 -0
- data/generated/google/apis/bigqueryreservation_v1alpha2/service.rb +71 -0
- data/generated/google/apis/bigqueryreservation_v1alpha2.rb +1 -1
- data/generated/google/apis/bigqueryreservation_v1beta1/classes.rb +61 -77
- data/generated/google/apis/bigqueryreservation_v1beta1/representations.rb +16 -17
- data/generated/google/apis/bigqueryreservation_v1beta1/service.rb +116 -78
- data/generated/google/apis/bigqueryreservation_v1beta1.rb +1 -1
- data/generated/google/apis/bigtableadmin_v1/classes.rb +1 -1
- data/generated/google/apis/bigtableadmin_v1.rb +1 -1
- data/generated/google/apis/bigtableadmin_v2/classes.rb +63 -30
- data/generated/google/apis/bigtableadmin_v2/service.rb +1 -1
- data/generated/google/apis/bigtableadmin_v2.rb +1 -1
- data/generated/google/apis/billingbudgets_v1beta1/classes.rb +392 -0
- data/generated/google/apis/billingbudgets_v1beta1/representations.rb +191 -0
- data/generated/google/apis/billingbudgets_v1beta1/service.rb +233 -0
- data/generated/google/apis/billingbudgets_v1beta1.rb +35 -0
- data/generated/google/apis/binaryauthorization_v1/classes.rb +6 -5
- data/generated/google/apis/binaryauthorization_v1/service.rb +2 -0
- data/generated/google/apis/binaryauthorization_v1.rb +1 -1
- data/generated/google/apis/binaryauthorization_v1beta1/classes.rb +6 -5
- data/generated/google/apis/binaryauthorization_v1beta1/service.rb +2 -0
- data/generated/google/apis/binaryauthorization_v1beta1.rb +1 -1
- data/generated/google/apis/books_v1/classes.rb +20 -0
- data/generated/google/apis/books_v1/representations.rb +3 -0
- data/generated/google/apis/books_v1.rb +1 -1
- data/generated/google/apis/calendar_v3/classes.rb +1 -1
- data/generated/google/apis/calendar_v3/service.rb +18 -30
- data/generated/google/apis/calendar_v3.rb +1 -1
- data/generated/google/apis/civicinfo_v2/classes.rb +0 -156
- data/generated/google/apis/civicinfo_v2/representations.rb +2 -60
- data/generated/google/apis/civicinfo_v2.rb +1 -1
- data/generated/google/apis/cloudasset_v1/classes.rb +89 -55
- data/generated/google/apis/cloudasset_v1/service.rb +1 -2
- data/generated/google/apis/cloudasset_v1.rb +1 -1
- data/generated/google/apis/cloudasset_v1beta1/classes.rb +75 -40
- data/generated/google/apis/cloudasset_v1beta1.rb +1 -1
- data/generated/google/apis/cloudbilling_v1/classes.rb +82 -36
- data/generated/google/apis/cloudbilling_v1/representations.rb +0 -1
- data/generated/google/apis/cloudbilling_v1/service.rb +5 -3
- data/generated/google/apis/cloudbilling_v1.rb +1 -1
- data/generated/google/apis/cloudbuild_v1/classes.rb +8 -2
- data/generated/google/apis/cloudbuild_v1/representations.rb +1 -0
- data/generated/google/apis/cloudbuild_v1/service.rb +18 -18
- data/generated/google/apis/cloudbuild_v1.rb +1 -1
- data/generated/google/apis/clouddebugger_v2/service.rb +14 -14
- data/generated/google/apis/clouddebugger_v2.rb +1 -1
- data/generated/google/apis/cloudfunctions_v1/classes.rb +13 -5
- data/generated/google/apis/cloudfunctions_v1/representations.rb +1 -0
- data/generated/google/apis/cloudfunctions_v1/service.rb +10 -4
- data/generated/google/apis/cloudfunctions_v1.rb +1 -1
- data/generated/google/apis/cloudfunctions_v1beta2/classes.rb +7 -0
- data/generated/google/apis/cloudfunctions_v1beta2/representations.rb +1 -0
- data/generated/google/apis/cloudfunctions_v1beta2/service.rb +10 -4
- data/generated/google/apis/cloudfunctions_v1beta2.rb +1 -1
- data/generated/google/apis/cloudidentity_v1/classes.rb +11 -8
- data/generated/google/apis/cloudidentity_v1/service.rb +2 -1
- data/generated/google/apis/cloudidentity_v1.rb +1 -1
- data/generated/google/apis/cloudidentity_v1beta1/classes.rb +13 -10
- data/generated/google/apis/cloudidentity_v1beta1/service.rb +2 -1
- data/generated/google/apis/cloudidentity_v1beta1.rb +1 -1
- data/generated/google/apis/cloudiot_v1/classes.rb +6 -5
- data/generated/google/apis/cloudiot_v1.rb +1 -1
- data/generated/google/apis/cloudkms_v1/classes.rb +6 -5
- data/generated/google/apis/cloudkms_v1/service.rb +3 -0
- data/generated/google/apis/cloudkms_v1.rb +1 -1
- data/generated/google/apis/cloudprivatecatalogproducer_v1beta1/classes.rb +75 -40
- data/generated/google/apis/cloudprivatecatalogproducer_v1beta1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1/classes.rb +18 -17
- data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +6 -5
- data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v2/classes.rb +10 -13
- data/generated/google/apis/cloudresourcemanager_v2/service.rb +11 -13
- data/generated/google/apis/cloudresourcemanager_v2.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v2beta1/classes.rb +10 -13
- data/generated/google/apis/cloudresourcemanager_v2beta1/service.rb +11 -13
- data/generated/google/apis/cloudresourcemanager_v2beta1.rb +1 -1
- data/generated/google/apis/cloudscheduler_v1/classes.rb +2 -1
- data/generated/google/apis/cloudscheduler_v1.rb +1 -1
- data/generated/google/apis/cloudscheduler_v1beta1/classes.rb +2 -1
- data/generated/google/apis/cloudscheduler_v1beta1.rb +1 -1
- data/generated/google/apis/cloudsearch_v1/classes.rb +10 -132
- data/generated/google/apis/cloudsearch_v1/representations.rb +0 -75
- data/generated/google/apis/cloudsearch_v1/service.rb +47 -9
- data/generated/google/apis/cloudsearch_v1.rb +8 -8
- data/generated/google/apis/cloudshell_v1/classes.rb +24 -1
- data/generated/google/apis/cloudshell_v1/representations.rb +3 -0
- data/generated/google/apis/cloudshell_v1.rb +1 -1
- data/generated/google/apis/cloudshell_v1alpha1/classes.rb +24 -1
- data/generated/google/apis/cloudshell_v1alpha1/representations.rb +3 -0
- data/generated/google/apis/cloudshell_v1alpha1.rb +1 -1
- data/generated/google/apis/cloudtasks_v2/classes.rb +212 -5
- data/generated/google/apis/cloudtasks_v2/representations.rb +50 -0
- data/generated/google/apis/cloudtasks_v2.rb +1 -1
- data/generated/google/apis/cloudtasks_v2beta2/classes.rb +6 -5
- data/generated/google/apis/cloudtasks_v2beta2.rb +1 -1
- data/generated/google/apis/cloudtasks_v2beta3/classes.rb +6 -5
- data/generated/google/apis/cloudtasks_v2beta3.rb +1 -1
- data/generated/google/apis/commentanalyzer_v1alpha1/classes.rb +14 -19
- data/generated/google/apis/commentanalyzer_v1alpha1.rb +1 -1
- data/generated/google/apis/compute_alpha/classes.rb +594 -164
- data/generated/google/apis/compute_alpha/representations.rb +110 -2
- data/generated/google/apis/compute_alpha/service.rb +1035 -640
- data/generated/google/apis/compute_alpha.rb +1 -1
- data/generated/google/apis/compute_beta/classes.rb +1070 -276
- data/generated/google/apis/compute_beta/representations.rb +284 -0
- data/generated/google/apis/compute_beta/service.rb +1242 -532
- data/generated/google/apis/compute_beta.rb +1 -1
- data/generated/google/apis/compute_v1/classes.rb +335 -133
- data/generated/google/apis/compute_v1/representations.rb +24 -0
- data/generated/google/apis/compute_v1/service.rb +759 -473
- data/generated/google/apis/compute_v1.rb +1 -1
- data/generated/google/apis/container_v1/classes.rb +410 -83
- data/generated/google/apis/container_v1/representations.rb +134 -0
- data/generated/google/apis/container_v1/service.rb +119 -119
- data/generated/google/apis/container_v1.rb +1 -1
- data/generated/google/apis/container_v1beta1/classes.rb +157 -3
- data/generated/google/apis/container_v1beta1/representations.rb +38 -0
- data/generated/google/apis/container_v1beta1.rb +1 -1
- data/generated/google/apis/containeranalysis_v1alpha1/classes.rb +6 -5
- data/generated/google/apis/containeranalysis_v1alpha1.rb +1 -1
- data/generated/google/apis/containeranalysis_v1beta1/classes.rb +6 -5
- data/generated/google/apis/containeranalysis_v1beta1.rb +1 -1
- data/generated/google/apis/content_v2/classes.rb +35 -223
- data/generated/google/apis/content_v2/representations.rb +0 -115
- data/generated/google/apis/content_v2/service.rb +0 -160
- data/generated/google/apis/content_v2.rb +1 -1
- data/generated/google/apis/content_v2_1/classes.rb +69 -21
- data/generated/google/apis/content_v2_1/representations.rb +3 -0
- data/generated/google/apis/content_v2_1.rb +1 -1
- data/generated/google/apis/datacatalog_v1beta1/classes.rb +1646 -0
- data/generated/google/apis/datacatalog_v1beta1/representations.rb +700 -0
- data/generated/google/apis/datacatalog_v1beta1/service.rb +1982 -0
- data/generated/google/apis/{cloudbuild_v1alpha1.rb → datacatalog_v1beta1.rb} +10 -9
- data/generated/google/apis/dataflow_v1b3/classes.rb +6 -9
- data/generated/google/apis/dataflow_v1b3/representations.rb +1 -1
- data/generated/google/apis/dataflow_v1b3.rb +1 -1
- data/generated/google/apis/datafusion_v1beta1/classes.rb +156 -46
- data/generated/google/apis/datafusion_v1beta1/representations.rb +33 -0
- data/generated/google/apis/datafusion_v1beta1/service.rb +10 -1
- data/generated/google/apis/datafusion_v1beta1.rb +1 -1
- data/generated/google/apis/dataproc_v1/classes.rb +119 -11
- data/generated/google/apis/dataproc_v1/representations.rb +39 -0
- data/generated/google/apis/dataproc_v1/service.rb +14 -7
- data/generated/google/apis/dataproc_v1.rb +1 -1
- data/generated/google/apis/dataproc_v1beta2/classes.rb +9 -11
- data/generated/google/apis/dataproc_v1beta2/service.rb +26 -19
- data/generated/google/apis/dataproc_v1beta2.rb +1 -1
- data/generated/google/apis/datastore_v1/service.rb +85 -1
- data/generated/google/apis/datastore_v1.rb +1 -1
- data/generated/google/apis/datastore_v1beta3/service.rb +1 -1
- data/generated/google/apis/datastore_v1beta3.rb +1 -1
- data/generated/google/apis/dfareporting_v3_3/classes.rb +21 -1
- data/generated/google/apis/dfareporting_v3_3/service.rb +6 -6
- data/generated/google/apis/dfareporting_v3_3.rb +1 -1
- data/generated/google/apis/{dfareporting_v3_2 → dfareporting_v3_4}/classes.rb +1215 -797
- data/generated/google/apis/{dfareporting_v3_2 → dfareporting_v3_4}/representations.rb +593 -395
- data/generated/google/apis/{dfareporting_v3_2 → dfareporting_v3_4}/service.rb +966 -1074
- data/generated/google/apis/{dfareporting_v3_2.rb → dfareporting_v3_4.rb} +6 -6
- data/generated/google/apis/dialogflow_v2/classes.rb +509 -8
- data/generated/google/apis/dialogflow_v2/representations.rb +222 -0
- data/generated/google/apis/dialogflow_v2.rb +1 -1
- data/generated/google/apis/dialogflow_v2beta1/classes.rb +530 -8
- data/generated/google/apis/dialogflow_v2beta1/representations.rb +224 -0
- data/generated/google/apis/dialogflow_v2beta1.rb +1 -1
- data/generated/google/apis/dlp_v2/classes.rb +109 -33
- data/generated/google/apis/dlp_v2/representations.rb +23 -3
- data/generated/google/apis/dlp_v2/service.rb +1996 -209
- data/generated/google/apis/dlp_v2.rb +1 -1
- data/generated/google/apis/dns_v1beta2/classes.rb +47 -0
- data/generated/google/apis/dns_v1beta2/representations.rb +17 -0
- data/generated/google/apis/dns_v1beta2.rb +1 -1
- data/generated/google/apis/docs_v1/classes.rb +175 -0
- data/generated/google/apis/docs_v1/representations.rb +77 -0
- data/generated/google/apis/docs_v1.rb +1 -1
- data/generated/google/apis/doubleclickbidmanager_v1.rb +1 -1
- data/generated/google/apis/doubleclickbidmanager_v1_1/classes.rb +826 -0
- data/generated/google/apis/doubleclickbidmanager_v1_1/representations.rb +372 -0
- data/generated/google/apis/doubleclickbidmanager_v1_1/service.rb +371 -0
- data/generated/google/apis/{urlshortener_v1.rb → doubleclickbidmanager_v1_1.rb} +11 -11
- data/generated/google/apis/drive_v2/classes.rb +2 -1
- data/generated/google/apis/drive_v2/service.rb +3 -3
- data/generated/google/apis/drive_v2.rb +1 -1
- data/generated/google/apis/drive_v3/classes.rb +12 -3
- data/generated/google/apis/drive_v3.rb +1 -1
- data/generated/google/apis/fcm_v1/classes.rb +15 -0
- data/generated/google/apis/fcm_v1/representations.rb +2 -0
- data/generated/google/apis/fcm_v1.rb +1 -1
- data/generated/google/apis/firebase_v1beta1/classes.rb +18 -4
- data/generated/google/apis/firebase_v1beta1/representations.rb +2 -0
- data/generated/google/apis/firebase_v1beta1/service.rb +6 -6
- data/generated/google/apis/firebase_v1beta1.rb +1 -1
- data/generated/google/apis/firebasehosting_v1beta1/classes.rb +62 -0
- data/generated/google/apis/firebasehosting_v1beta1/representations.rb +31 -0
- data/generated/google/apis/firebasehosting_v1beta1/service.rb +47 -0
- data/generated/google/apis/firebasehosting_v1beta1.rb +1 -1
- data/generated/google/apis/firebaserules_v1/classes.rb +26 -0
- data/generated/google/apis/firebaserules_v1/representations.rb +15 -0
- data/generated/google/apis/firebaserules_v1.rb +1 -1
- data/generated/google/apis/firestore_v1.rb +1 -1
- data/generated/google/apis/firestore_v1beta1.rb +1 -1
- data/generated/google/apis/fitness_v1/service.rb +1 -1
- data/generated/google/apis/fitness_v1.rb +1 -1
- data/generated/google/apis/games_management_v1management/classes.rb +6 -26
- data/generated/google/apis/games_management_v1management/representations.rb +1 -14
- data/generated/google/apis/games_management_v1management/service.rb +0 -158
- data/generated/google/apis/games_management_v1management.rb +1 -1
- data/generated/google/apis/games_v1/classes.rb +6 -292
- data/generated/google/apis/games_v1/representations.rb +1 -98
- data/generated/google/apis/games_v1/service.rb +0 -123
- data/generated/google/apis/games_v1.rb +1 -1
- data/generated/google/apis/genomics_v2alpha1/classes.rb +32 -0
- data/generated/google/apis/genomics_v2alpha1/representations.rb +16 -0
- data/generated/google/apis/genomics_v2alpha1.rb +1 -1
- data/generated/google/apis/healthcare_v1beta1/classes.rb +213 -16
- data/generated/google/apis/healthcare_v1beta1/representations.rb +101 -0
- data/generated/google/apis/healthcare_v1beta1/service.rb +207 -116
- data/generated/google/apis/healthcare_v1beta1.rb +1 -1
- data/generated/google/apis/homegraph_v1/classes.rb +15 -1
- data/generated/google/apis/homegraph_v1/representations.rb +2 -1
- data/generated/google/apis/homegraph_v1.rb +1 -1
- data/generated/google/apis/iam_v1/classes.rb +15 -7
- data/generated/google/apis/iam_v1/representations.rb +1 -0
- data/generated/google/apis/iam_v1.rb +1 -1
- data/generated/google/apis/iap_v1/classes.rb +187 -2
- data/generated/google/apis/iap_v1/representations.rb +102 -0
- data/generated/google/apis/iap_v1/service.rb +72 -0
- data/generated/google/apis/iap_v1.rb +1 -1
- data/generated/google/apis/iap_v1beta1/classes.rb +2 -2
- data/generated/google/apis/iap_v1beta1.rb +1 -1
- data/generated/google/apis/jobs_v2/classes.rb +167 -0
- data/generated/google/apis/jobs_v2/representations.rb +40 -0
- data/generated/google/apis/jobs_v2.rb +1 -1
- data/generated/google/apis/jobs_v3/classes.rb +179 -0
- data/generated/google/apis/jobs_v3/representations.rb +41 -0
- data/generated/google/apis/jobs_v3.rb +1 -1
- data/generated/google/apis/jobs_v3p1beta1/classes.rb +179 -0
- data/generated/google/apis/jobs_v3p1beta1/representations.rb +41 -0
- data/generated/google/apis/jobs_v3p1beta1.rb +1 -1
- data/generated/google/apis/licensing_v1/classes.rb +15 -7
- data/generated/google/apis/licensing_v1/service.rb +81 -37
- data/generated/google/apis/licensing_v1.rb +4 -4
- data/generated/google/apis/lifesciences_v2beta/classes.rb +1329 -0
- data/generated/google/apis/lifesciences_v2beta/representations.rb +533 -0
- data/generated/google/apis/lifesciences_v2beta/service.rb +303 -0
- data/generated/google/apis/lifesciences_v2beta.rb +35 -0
- data/generated/google/apis/logging_v2/classes.rb +30 -2
- data/generated/google/apis/logging_v2/representations.rb +4 -0
- data/generated/google/apis/logging_v2/service.rb +10 -5
- data/generated/google/apis/logging_v2.rb +1 -1
- data/generated/google/apis/ml_v1/classes.rb +308 -155
- data/generated/google/apis/ml_v1/representations.rb +59 -0
- data/generated/google/apis/ml_v1/service.rb +44 -3
- data/generated/google/apis/ml_v1.rb +2 -2
- data/generated/google/apis/monitoring_v1/classes.rb +1153 -0
- data/generated/google/apis/monitoring_v1/representations.rb +528 -0
- data/generated/google/apis/{cloudbuild_v1alpha1 → monitoring_v1}/service.rb +86 -63
- data/generated/google/apis/monitoring_v1.rb +48 -0
- data/generated/google/apis/monitoring_v3/classes.rb +836 -60
- data/generated/google/apis/monitoring_v3/representations.rb +348 -0
- data/generated/google/apis/monitoring_v3/service.rb +384 -2
- data/generated/google/apis/monitoring_v3.rb +1 -1
- data/generated/google/apis/oslogin_v1/classes.rb +1 -1
- data/generated/google/apis/oslogin_v1/service.rb +10 -6
- data/generated/google/apis/oslogin_v1.rb +1 -1
- data/generated/google/apis/oslogin_v1beta/classes.rb +1 -1
- data/generated/google/apis/oslogin_v1beta/service.rb +9 -5
- data/generated/google/apis/oslogin_v1beta.rb +1 -1
- data/generated/google/apis/pagespeedonline_v5/classes.rb +8 -0
- data/generated/google/apis/pagespeedonline_v5/representations.rb +1 -0
- data/generated/google/apis/pagespeedonline_v5.rb +1 -1
- data/generated/google/apis/people_v1/classes.rb +67 -63
- data/generated/google/apis/people_v1/service.rb +53 -44
- data/generated/google/apis/people_v1.rb +1 -1
- data/generated/google/apis/policytroubleshooter_v1beta/classes.rb +168 -90
- data/generated/google/apis/policytroubleshooter_v1beta/service.rb +2 -3
- data/generated/google/apis/policytroubleshooter_v1beta.rb +1 -1
- data/generated/google/apis/pubsub_v1/classes.rb +8 -6
- data/generated/google/apis/pubsub_v1/service.rb +9 -7
- data/generated/google/apis/pubsub_v1.rb +1 -1
- data/generated/google/apis/pubsub_v1beta2/classes.rb +6 -5
- data/generated/google/apis/pubsub_v1beta2/service.rb +2 -0
- data/generated/google/apis/pubsub_v1beta2.rb +1 -1
- data/generated/google/apis/recommender_v1beta1/classes.rb +1 -1
- data/generated/google/apis/recommender_v1beta1/service.rb +10 -8
- data/generated/google/apis/recommender_v1beta1.rb +1 -1
- data/generated/google/apis/redis_v1/classes.rb +11 -11
- data/generated/google/apis/redis_v1/service.rb +5 -5
- data/generated/google/apis/redis_v1.rb +1 -1
- data/generated/google/apis/redis_v1beta1/classes.rb +11 -11
- data/generated/google/apis/redis_v1beta1/service.rb +5 -5
- data/generated/google/apis/redis_v1beta1.rb +1 -1
- data/generated/google/apis/remotebuildexecution_v1/classes.rb +113 -0
- data/generated/google/apis/remotebuildexecution_v1/representations.rb +50 -0
- data/generated/google/apis/remotebuildexecution_v1.rb +1 -1
- data/generated/google/apis/remotebuildexecution_v1alpha/classes.rb +113 -0
- data/generated/google/apis/remotebuildexecution_v1alpha/representations.rb +50 -0
- data/generated/google/apis/remotebuildexecution_v1alpha.rb +1 -1
- data/generated/google/apis/remotebuildexecution_v2/classes.rb +113 -0
- data/generated/google/apis/remotebuildexecution_v2/representations.rb +50 -0
- data/generated/google/apis/remotebuildexecution_v2.rb +1 -1
- data/generated/google/apis/reseller_v1/service.rb +1 -1
- data/generated/google/apis/reseller_v1.rb +1 -1
- data/generated/google/apis/run_v1/classes.rb +8 -176
- data/generated/google/apis/run_v1/representations.rb +0 -71
- data/generated/google/apis/run_v1/service.rb +209 -1125
- data/generated/google/apis/run_v1.rb +1 -1
- data/generated/google/apis/run_v1alpha1/classes.rb +328 -9
- data/generated/google/apis/run_v1alpha1/representations.rb +126 -0
- data/generated/google/apis/run_v1alpha1/service.rb +408 -0
- data/generated/google/apis/run_v1alpha1.rb +1 -1
- data/generated/google/apis/runtimeconfig_v1beta1/classes.rb +75 -40
- data/generated/google/apis/runtimeconfig_v1beta1.rb +1 -1
- data/generated/google/apis/securitycenter_v1/classes.rb +159 -66
- data/generated/google/apis/securitycenter_v1/representations.rb +19 -0
- data/generated/google/apis/securitycenter_v1/service.rb +14 -12
- data/generated/google/apis/securitycenter_v1.rb +1 -1
- data/generated/google/apis/securitycenter_v1beta1/classes.rb +95 -57
- data/generated/google/apis/securitycenter_v1beta1/service.rb +14 -12
- data/generated/google/apis/securitycenter_v1beta1.rb +1 -1
- data/generated/google/apis/servicebroker_v1/classes.rb +75 -40
- data/generated/google/apis/servicebroker_v1.rb +1 -1
- data/generated/google/apis/servicebroker_v1alpha1/classes.rb +75 -40
- data/generated/google/apis/servicebroker_v1alpha1.rb +1 -1
- data/generated/google/apis/servicebroker_v1beta1/classes.rb +75 -40
- data/generated/google/apis/servicebroker_v1beta1.rb +1 -1
- data/generated/google/apis/serviceconsumermanagement_v1/classes.rb +95 -43
- data/generated/google/apis/serviceconsumermanagement_v1/representations.rb +30 -0
- data/generated/google/apis/serviceconsumermanagement_v1.rb +1 -1
- data/generated/google/apis/servicecontrol_v1/classes.rb +8 -12
- data/generated/google/apis/servicecontrol_v1/representations.rb +1 -1
- data/generated/google/apis/servicecontrol_v1.rb +1 -1
- data/generated/google/apis/servicemanagement_v1/classes.rb +142 -91
- data/generated/google/apis/servicemanagement_v1/representations.rb +24 -0
- data/generated/google/apis/servicemanagement_v1/service.rb +32 -26
- data/generated/google/apis/servicemanagement_v1.rb +1 -1
- data/generated/google/apis/servicenetworking_v1/classes.rb +181 -54
- data/generated/google/apis/servicenetworking_v1/representations.rb +71 -0
- data/generated/google/apis/servicenetworking_v1/service.rb +77 -3
- data/generated/google/apis/servicenetworking_v1.rb +1 -1
- data/generated/google/apis/servicenetworking_v1beta/classes.rb +32 -43
- data/generated/google/apis/servicenetworking_v1beta.rb +1 -1
- data/generated/google/apis/serviceusage_v1/classes.rb +87 -43
- data/generated/google/apis/serviceusage_v1/representations.rb +29 -0
- data/generated/google/apis/serviceusage_v1.rb +1 -1
- data/generated/google/apis/serviceusage_v1beta1/classes.rb +87 -43
- data/generated/google/apis/serviceusage_v1beta1/representations.rb +29 -0
- data/generated/google/apis/serviceusage_v1beta1.rb +1 -1
- data/generated/google/apis/sheets_v4/classes.rb +1371 -232
- data/generated/google/apis/sheets_v4/representations.rb +180 -0
- data/generated/google/apis/sheets_v4.rb +1 -1
- data/generated/google/apis/spanner_v1/classes.rb +70 -30
- data/generated/google/apis/spanner_v1/service.rb +270 -0
- data/generated/google/apis/spanner_v1.rb +1 -1
- data/generated/google/apis/speech_v1/classes.rb +6 -0
- data/generated/google/apis/speech_v1/representations.rb +1 -0
- data/generated/google/apis/speech_v1.rb +1 -1
- data/generated/google/apis/speech_v1p1beta1/classes.rb +6 -0
- data/generated/google/apis/speech_v1p1beta1/representations.rb +1 -0
- data/generated/google/apis/speech_v1p1beta1.rb +1 -1
- data/generated/google/apis/{speech_v2beta → speech_v2beta1}/classes.rb +9 -8
- data/generated/google/apis/{speech_v2beta → speech_v2beta1}/representations.rb +6 -6
- data/generated/google/apis/{speech_v2beta → speech_v2beta1}/service.rb +13 -13
- data/generated/google/apis/{speech_v2beta.rb → speech_v2beta1.rb} +6 -6
- data/generated/google/apis/{sqladmin_v1beta4 → sql_v1beta4}/classes.rb +499 -380
- data/generated/google/apis/{sqladmin_v1beta4 → sql_v1beta4}/representations.rb +125 -104
- data/generated/google/apis/{sqladmin_v1beta4 → sql_v1beta4}/service.rb +637 -590
- data/generated/google/apis/{sqladmin_v1beta4.rb → sql_v1beta4.rb} +7 -8
- data/generated/google/apis/storage_v1.rb +1 -1
- data/generated/google/apis/storagetransfer_v1.rb +1 -1
- data/generated/google/apis/streetviewpublish_v1/classes.rb +1 -1
- data/generated/google/apis/streetviewpublish_v1.rb +1 -1
- data/generated/google/apis/testing_v1/classes.rb +142 -1
- data/generated/google/apis/testing_v1/representations.rb +76 -0
- data/generated/google/apis/testing_v1.rb +1 -1
- data/generated/google/apis/videointelligence_v1/classes.rb +147 -36
- data/generated/google/apis/videointelligence_v1/representations.rb +62 -0
- data/generated/google/apis/videointelligence_v1.rb +1 -1
- data/generated/google/apis/videointelligence_v1beta2/classes.rb +147 -36
- data/generated/google/apis/videointelligence_v1beta2/representations.rb +62 -0
- data/generated/google/apis/videointelligence_v1beta2.rb +1 -1
- data/generated/google/apis/videointelligence_v1p1beta1/classes.rb +147 -36
- data/generated/google/apis/videointelligence_v1p1beta1/representations.rb +62 -0
- data/generated/google/apis/videointelligence_v1p1beta1.rb +1 -1
- data/generated/google/apis/videointelligence_v1p2beta1/classes.rb +147 -36
- data/generated/google/apis/videointelligence_v1p2beta1/representations.rb +62 -0
- data/generated/google/apis/videointelligence_v1p2beta1.rb +1 -1
- data/generated/google/apis/videointelligence_v1p3beta1/classes.rb +147 -36
- data/generated/google/apis/videointelligence_v1p3beta1/representations.rb +62 -0
- data/generated/google/apis/videointelligence_v1p3beta1.rb +1 -1
- data/generated/google/apis/vision_v1/classes.rb +66 -0
- data/generated/google/apis/vision_v1/representations.rb +32 -0
- data/generated/google/apis/vision_v1.rb +1 -1
- data/generated/google/apis/vision_v1p1beta1/classes.rb +66 -0
- data/generated/google/apis/vision_v1p1beta1/representations.rb +32 -0
- data/generated/google/apis/vision_v1p1beta1.rb +1 -1
- data/generated/google/apis/vision_v1p2beta1/classes.rb +66 -0
- data/generated/google/apis/vision_v1p2beta1/representations.rb +32 -0
- data/generated/google/apis/vision_v1p2beta1.rb +1 -1
- data/generated/google/apis/youtube_partner_v1/service.rb +2 -2
- data/generated/google/apis/youtube_partner_v1.rb +1 -1
- data/google-api-client.gemspec +6 -3
- data/lib/google/apis/core/api_command.rb +3 -0
- data/lib/google/apis/core/http_command.rb +10 -8
- data/lib/google/apis/core/upload.rb +4 -0
- data/lib/google/apis/version.rb +1 -1
- data/rakelib/devsite/devsite_builder.rb +126 -0
- data/rakelib/devsite/link_checker.rb +64 -0
- data/rakelib/devsite/repo_metadata.rb +56 -0
- metadata +64 -42
- data/generated/google/apis/cloudbuild_v1alpha1/classes.rb +0 -1168
- data/generated/google/apis/cloudbuild_v1alpha1/representations.rb +0 -434
- data/generated/google/apis/storage_v1beta1/classes.rb +0 -616
- data/generated/google/apis/storage_v1beta1/representations.rb +0 -249
- data/generated/google/apis/storage_v1beta1/service.rb +0 -1032
- data/generated/google/apis/storage_v1beta1.rb +0 -40
- data/generated/google/apis/urlshortener_v1/classes.rb +0 -246
- data/generated/google/apis/urlshortener_v1/representations.rb +0 -121
- data/generated/google/apis/urlshortener_v1/service.rb +0 -169
data/docs/oauth.md
ADDED
@@ -0,0 +1,268 @@
|
|
1
|
+
# OAuth 2.0
|
2
|
+
|
3
|
+
This document describes OAuth 2.0, when to use it, how to acquire client IDs and client secrets, and generally how to use OAuth 2.0 with the Google API Client Library for Ruby.
|
4
|
+
|
5
|
+
## About OAuth 2.0
|
6
|
+
|
7
|
+
OAuth 2.0 is the authorization protocol used by Google APIs. It is summarized on the Authentication page of this library's documentation, and there are other good references as well:
|
8
|
+
|
9
|
+
- [The OAuth 2.0 Authorization Protocol](https://tools.ietf.org/html/rfc6749)
|
10
|
+
- [Using OAuth 2.0 to Access Google APIs](https://developers.google.com/identity/protocols/OAuth2)
|
11
|
+
|
12
|
+
## Acquiring client IDs and secrets
|
13
|
+
|
14
|
+
To find your project's client ID and client secret, do the following:
|
15
|
+
|
16
|
+
Select an existing OAuth 2.0 credential or open the Credentials page.
|
17
|
+
If you haven't done so already, create your project's OAuth 2.0 credentials by clicking Create credentials > OAuth client ID, and providing the information needed to create the credentials.
|
18
|
+
Look for the Client ID in the OAuth 2.0 client IDs section. For details, click the client ID.
|
19
|
+
There are different types of client IDs, so be sure to get the correct type for your application:
|
20
|
+
|
21
|
+
* Web application client IDs
|
22
|
+
* Installed application client IDs
|
23
|
+
* [Service Account](https://developers.google.com/accounts/docs/OAuth2ServiceAccount) client IDs
|
24
|
+
|
25
|
+
**Warning**: Keep your client secret private. If someone obtains your client secret, they could use it to consume your quota, incur charges against your Google APIs Console project, and request access to user data.
|
26
|
+
|
27
|
+
## The Signet library
|
28
|
+
|
29
|
+
The [Signet](https://github.com/googleapis/signet) library is included with the Google API Client Library for Ruby. It handles all steps of the OAuth 2.0 protocol required for making API calls. It is available as a separate gem if you only need an OAuth 2.0 library.
|
30
|
+
|
31
|
+
## Flows
|
32
|
+
|
33
|
+
There are three main OAuth 2.0 flows in the Google API Client Library for Ruby: web server, installed application and service account.
|
34
|
+
|
35
|
+
## Web server
|
36
|
+
|
37
|
+
We start by retrieving the client ID and client secret from a preconfigured client_secrets.json file:
|
38
|
+
|
39
|
+
```rb
|
40
|
+
client_secrets = Google::APIClient::ClientSecrets.load
|
41
|
+
```
|
42
|
+
For web-based applications, we then redirect the user to an authorization page:
|
43
|
+
|
44
|
+
```rb
|
45
|
+
# Request authorization
|
46
|
+
redirect user_credentials.authorization_uri.to_s, 303
|
47
|
+
```
|
48
|
+
|
49
|
+
The user completes the steps on her browser, and control gets returned to the application via the callback URL:
|
50
|
+
|
51
|
+
```rb
|
52
|
+
get '/oauth2callback' do
|
53
|
+
# Exchange token
|
54
|
+
user_credentials.code = params[:code] if params[:code]
|
55
|
+
user_credentials.fetch_access_token!
|
56
|
+
redirect to('/')
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
60
|
+
user_credentials now has everything needed to make authenticated requests:
|
61
|
+
|
62
|
+
```rb
|
63
|
+
events = calendar.list_events('primary', options: { authorization: user_credentials })
|
64
|
+
```
|
65
|
+
|
66
|
+
Below is the full sample we've been looking at.
|
67
|
+
|
68
|
+
```rb
|
69
|
+
require 'google/apis/calendar_v3'
|
70
|
+
require 'google/api_client/client_secrets'
|
71
|
+
require 'sinatra'
|
72
|
+
require 'logger'
|
73
|
+
|
74
|
+
enable :sessions
|
75
|
+
|
76
|
+
def logger; settings.logger end
|
77
|
+
|
78
|
+
def calendar; settings.calendar; end
|
79
|
+
|
80
|
+
def user_credentials
|
81
|
+
# Build a per-request oauth credential based on token stored in session
|
82
|
+
# which allows us to use a shared API client.
|
83
|
+
@authorization ||= (
|
84
|
+
auth = settings.authorization.dup
|
85
|
+
auth.redirect_uri = to('/oauth2callback')
|
86
|
+
auth.update_token!(session)
|
87
|
+
auth
|
88
|
+
)
|
89
|
+
end
|
90
|
+
|
91
|
+
configure do
|
92
|
+
log_file = File.open('calendar.log', 'a+')
|
93
|
+
log_file.sync = true
|
94
|
+
logger = Logger.new(log_file)
|
95
|
+
logger.level = Logger::DEBUG
|
96
|
+
|
97
|
+
Google::Apis::ClientOptions.default.application_name = 'Ruby Calendar sample'
|
98
|
+
Google::Apis::ClientOptions.default.application_version = '1.0.0'
|
99
|
+
calendar_api = Google::Apis::CalendarV3::CalendarService.new
|
100
|
+
|
101
|
+
client_secrets = Google::APIClient::ClientSecrets.load
|
102
|
+
authorization = client_secrets.to_authorization
|
103
|
+
authorization.scope = 'https://www.googleapis.com/auth/calendar'
|
104
|
+
|
105
|
+
set :authorization, authorization
|
106
|
+
set :logger, logger
|
107
|
+
set :calendar, calendar_api
|
108
|
+
end
|
109
|
+
|
110
|
+
before do
|
111
|
+
# Ensure user has authorized the app
|
112
|
+
unless user_credentials.access_token || request.path_info =~ /^\/oauth2/
|
113
|
+
redirect to('/oauth2authorize')
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
after do
|
118
|
+
# Serialize the access/refresh token to the session and credential store.
|
119
|
+
session[:access_token] = user_credentials.access_token
|
120
|
+
session[:refresh_token] = user_credentials.refresh_token
|
121
|
+
session[:expires_in] = user_credentials.expires_in
|
122
|
+
session[:issued_at] = user_credentials.issued_at
|
123
|
+
end
|
124
|
+
|
125
|
+
get '/oauth2authorize' do
|
126
|
+
# Request authorization
|
127
|
+
redirect user_credentials.authorization_uri.to_s, 303
|
128
|
+
end
|
129
|
+
|
130
|
+
get '/oauth2callback' do
|
131
|
+
# Exchange token
|
132
|
+
user_credentials.code = params[:code] if params[:code]
|
133
|
+
user_credentials.fetch_access_token!
|
134
|
+
redirect to('/')
|
135
|
+
end
|
136
|
+
|
137
|
+
get '/' do
|
138
|
+
# Fetch list of events on the user's default calandar
|
139
|
+
events = calendar.list_events('primary', options: { authorization: user_credentials })
|
140
|
+
[200, {'Content-Type' => 'application/json'}, events.to_h.to_json]
|
141
|
+
end
|
142
|
+
```
|
143
|
+
|
144
|
+
### Installed application
|
145
|
+
|
146
|
+
We start by retrieving the client ID and client secret from a preconfigured client_secrets.json file:
|
147
|
+
|
148
|
+
```rb
|
149
|
+
client_secrets = Google::APIClient::ClientSecrets.load
|
150
|
+
```
|
151
|
+
|
152
|
+
For installed applications, we can use the Google::APIClient::InstalledAppFlow helper class to handle most of the setup:
|
153
|
+
|
154
|
+
```rb
|
155
|
+
flow = Google::APIClient::InstalledAppFlow.new(
|
156
|
+
:client_id => client_secrets.client_id,
|
157
|
+
:client_secret => client_secrets.client_secret,
|
158
|
+
:scope => ['https://www.googleapis.com/auth/adsense.readonly']
|
159
|
+
)
|
160
|
+
```
|
161
|
+
|
162
|
+
The user completes the steps on her browser, which is opened automatically, and the authorization code is fed into the application automatically, so all it takes is:
|
163
|
+
|
164
|
+
```rb
|
165
|
+
adsense.authorization = flow.authorize(storage)
|
166
|
+
```
|
167
|
+
|
168
|
+
The client now has everything needed to make an authenticated request:
|
169
|
+
|
170
|
+
```rb
|
171
|
+
report = adsense.generate_report(start_date: '2011-01-01', end_date: '2011-08-31',
|
172
|
+
metric: %w(PAGE_VIEWS AD_REQUESTS AD_REQUESTS_COVERAGE
|
173
|
+
CLICKS AD_REQUESTS_CTR COST_PER_CLICK
|
174
|
+
AD_REQUESTS_RPM EARNINGS),
|
175
|
+
dimension: %w(DATE),
|
176
|
+
sort: %w(+DATE))
|
177
|
+
```
|
178
|
+
|
179
|
+
Below is the full sample we've been looking at.
|
180
|
+
|
181
|
+
```rb
|
182
|
+
# AdSense Management API command-line sample.
|
183
|
+
require 'google/apis/adsense_v1_4'
|
184
|
+
require 'google/api_client/client_secrets'
|
185
|
+
require 'google/api_client/auth/installed_app'
|
186
|
+
require 'google/api_client/auth/storage'
|
187
|
+
require 'google/api_client/auth/storages/file_store'
|
188
|
+
require 'logger'
|
189
|
+
require 'json'
|
190
|
+
|
191
|
+
CREDENTIAL_STORE_FILE = "#{$0}-oauth2.json"
|
192
|
+
|
193
|
+
# Handles authentication and loading of the API.
|
194
|
+
def setup
|
195
|
+
log_file = File.open('adsense.log', 'a+')
|
196
|
+
log_file.sync = true
|
197
|
+
logger = Logger.new(log_file)
|
198
|
+
logger.level = Logger::DEBUG
|
199
|
+
|
200
|
+
adsense = Google::Apis::AdsenseV1_4::AdSenseService.new
|
201
|
+
|
202
|
+
# Stores auth credentials in a file, so they survive multiple runs
|
203
|
+
# of the application. This avoids prompting the user for authorization every
|
204
|
+
# time the access token expires, by remembering the refresh token.
|
205
|
+
# Note: FileStorage is not suitable for multi-user applications.
|
206
|
+
storage = Google::APIClient::Storage.new(
|
207
|
+
Google::APIClient::FileStore.new(CREDENTIAL_STORE_FILE))
|
208
|
+
adsense.authorization = storage.authorize
|
209
|
+
if storage.authorization.nil?
|
210
|
+
client_secrets = Google::APIClient::ClientSecrets.load
|
211
|
+
# The InstalledAppFlow is a helper class to handle the OAuth 2.0 installed
|
212
|
+
# application flow, which ties in with Stroage to store credentials
|
213
|
+
# between runs.
|
214
|
+
flow = Google::APIClient::InstalledAppFlow.new(
|
215
|
+
:client_id => client_secrets.client_id,
|
216
|
+
:client_secret => client_secrets.client_secret,
|
217
|
+
:scope => ['https://www.googleapis.com/auth/adsense.readonly']
|
218
|
+
)
|
219
|
+
adsense.authorization = flow.authorize(storage)
|
220
|
+
end
|
221
|
+
return adsense
|
222
|
+
end
|
223
|
+
|
224
|
+
# Generates a report for the default account.
|
225
|
+
def generate_report(adsense)
|
226
|
+
report = adsense.generate_report(start_date: '2011-01-01', end_date: '2011-08-31',
|
227
|
+
metric: %w(PAGE_VIEWS AD_REQUESTS AD_REQUESTS_COVERAGE
|
228
|
+
CLICKS AD_REQUESTS_CTR COST_PER_CLICK
|
229
|
+
AD_REQUESTS_RPM EARNINGS),
|
230
|
+
dimension: %w(DATE),
|
231
|
+
sort: %w(+DATE))
|
232
|
+
|
233
|
+
# Display headers.
|
234
|
+
report.headers.each do |header|
|
235
|
+
print '%25s' % header.name
|
236
|
+
end
|
237
|
+
puts
|
238
|
+
|
239
|
+
# Display results.
|
240
|
+
report.rows.each do |row|
|
241
|
+
row.each do |column|
|
242
|
+
print '%25s' % column
|
243
|
+
end
|
244
|
+
puts
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
|
249
|
+
if __FILE__ == $0
|
250
|
+
adsense = setup()
|
251
|
+
generate_report(adsense)
|
252
|
+
end
|
253
|
+
```
|
254
|
+
|
255
|
+
## Service accounts
|
256
|
+
|
257
|
+
For server-to-server interactions, like those between a web application and Google Cloud Storage, Prediction, or BigQuery APIs, you can use service accounts.
|
258
|
+
|
259
|
+
```rb
|
260
|
+
require 'googleauth'
|
261
|
+
require 'google/apis/compute_v1'
|
262
|
+
|
263
|
+
compute = Google::Apis::ComputeV1::ComputeService.new
|
264
|
+
|
265
|
+
# Get the environment configured authorization
|
266
|
+
scopes = ['https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/compute']
|
267
|
+
compute.authorization = Google::Auth.get_application_default(scopes)
|
268
|
+
```
|
data/docs/pagination.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Pagination
|
2
|
+
|
3
|
+
Some API methods may return very large lists of data. To reduce the response size, many of these API methods support pagination. With paginated results, your application can iteratively request and process large lists one page at a time. When using API methods that support pagination, responses will come back with a next_page property, which builds a request for the next page for you.
|
4
|
+
|
5
|
+
To process the first page of results, construct a request as you normally would. There's usually an API-level parameter you can provide to specify the maximum size of each page, so be sure to check the API's documentation.
|
6
|
+
|
7
|
+
`stamps = service.list_stamps(cents: 5, max_results: 20)`
|
8
|
+
|
9
|
+
For further pages, repeat the request including the next page token from the previous result.
|
10
|
+
|
11
|
+
`stamps = service.list_stamps(cents:5, max_results: 20, page_token: stamps.next_page_token)`
|
12
|
+
|
13
|
+
Here is a full example which loops through the paginated results of a user's public Google Plus activities feed:
|
14
|
+
|
15
|
+
```rb
|
16
|
+
require 'google/apis/plus_v1'
|
17
|
+
|
18
|
+
plus = Google::Apis::PlusV1::PlusService.new
|
19
|
+
plus.key = '...' # API Key from the Google Developers Console
|
20
|
+
next_page = nil
|
21
|
+
begin
|
22
|
+
puts "Fetching page of activities"
|
23
|
+
activities = plus.list_activities('103354693083460731603', 'public', page_token: next_page)
|
24
|
+
activities.items.each do |activity|
|
25
|
+
puts "#{activity.published} #{activity.title}"
|
26
|
+
end
|
27
|
+
next_page = activities.next_page_token
|
28
|
+
end while next_page
|
29
|
+
```
|
data/docs/performance.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Performance Tips
|
2
|
+
|
3
|
+
This document covers techniques you can use to improve the performance of your application. The documentation for the specific API you are using should have a similar page with more detail on some of these topics. For example, see the Performance Tips page for the Google Drive API.
|
4
|
+
|
5
|
+
## Partial response (fields parameter)
|
6
|
+
|
7
|
+
By default, the server sends back the full representation of a resource after processing requests. For better performance, you can ask the server to send only the fields you really need and get a partial response instead.
|
8
|
+
|
9
|
+
To request a partial response, add the standard fields parameter to any API method. The value of this parameter specifies the fields you want returned. You can use this parameter with any request that returns response data.
|
10
|
+
|
11
|
+
In the following code snippet, the list_stamps method of a fictitious Stamps API is called. The cents parameter is defined by the API to only return stamps with the given value. The value of the fields parameter is set to 'count,items/name'code>. The response will only contain stamps whose value is 5 cents, and the data returned will only include the number of stamps found along with the stamp names:
|
12
|
+
|
13
|
+
`response = service.list_stamps(cents: 5, fields: 'count,items/name')`
|
14
|
+
|
15
|
+
Note how commas are used to delimit the desired fields, and slashes are used to indicate fields that are contained in parent fields. There are other formatting options for the fields parameter, and you should see the "Performance Tips" page in the documentation for the API you are using.
|
16
|
+
|
17
|
+
## Partial update (patch)
|
18
|
+
|
19
|
+
If the API you are calling supports patch, you can avoid sending unnecessary data when modifying resources. For these APIs, you can call the patch() method and supply the arguments you wish to modify for the resource. If supported, the API's reference will have documentation for the patch() method.
|
20
|
+
|
21
|
+
For more information about patch semantics, see the "Performance Tips" page in the documentation for the API you are using.
|
22
|
+
|
23
|
+
## Batch
|
24
|
+
|
25
|
+
If you are sending many small requests you may benefit from batching, which allows those requests to be bundled into a single HTTP request.
|
@@ -26,6 +26,16 @@ module Google
|
|
26
26
|
class AccessApprovalSettings
|
27
27
|
include Google::Apis::Core::Hashable
|
28
28
|
|
29
|
+
# Output only. This field is read only (not settable via
|
30
|
+
# UpdateAccessAccessApprovalSettings method). If the field is true, that
|
31
|
+
# indicates that at least one service is enrolled for Access Approval in one
|
32
|
+
# or more ancestors of the Project or Folder (this field will always be
|
33
|
+
# unset for the organization since organizations do not have ancestors).
|
34
|
+
# Corresponds to the JSON property `enrolledAncestor`
|
35
|
+
# @return [Boolean]
|
36
|
+
attr_accessor :enrolled_ancestor
|
37
|
+
alias_method :enrolled_ancestor?, :enrolled_ancestor
|
38
|
+
|
29
39
|
# A list of Google Cloud Services for which the given resource has Access
|
30
40
|
# Approval enrolled. Access requests for the resource given by name against
|
31
41
|
# any of these services contained here will be required to have explicit
|
@@ -33,7 +43,9 @@ module Google
|
|
33
43
|
# individual services. If name refers to a folder or project, enrollment can
|
34
44
|
# only be done on an all or nothing basis.
|
35
45
|
# If a cloud_product is repeated in this list, the first entry will be
|
36
|
-
# honored and all following entries will be discarded.
|
46
|
+
# honored and all following entries will be discarded. A maximum of 10
|
47
|
+
# enrolled services will be enforced, to be expanded as the set of supported
|
48
|
+
# services is expanded.
|
37
49
|
# Corresponds to the JSON property `enrolledServices`
|
38
50
|
# @return [Array<Google::Apis::AccessapprovalV1beta1::EnrolledService>]
|
39
51
|
attr_accessor :enrolled_services
|
@@ -50,7 +62,8 @@ module Google
|
|
50
62
|
|
51
63
|
# A list of email addresses to which notifications relating to approval
|
52
64
|
# requests should be sent. Notifications relating to a resource will be sent
|
53
|
-
# to all emails in the settings of ancestor resources of that resource.
|
65
|
+
# to all emails in the settings of ancestor resources of that resource. A
|
66
|
+
# maximum of 50 email addresses are allowed.
|
54
67
|
# Corresponds to the JSON property `notificationEmails`
|
55
68
|
# @return [Array<String>]
|
56
69
|
attr_accessor :notification_emails
|
@@ -61,6 +74,7 @@ module Google
|
|
61
74
|
|
62
75
|
# Update properties of this object
|
63
76
|
def update!(**args)
|
77
|
+
@enrolled_ancestor = args[:enrolled_ancestor] if args.key?(:enrolled_ancestor)
|
64
78
|
@enrolled_services = args[:enrolled_services] if args.key?(:enrolled_services)
|
65
79
|
@name = args[:name] if args.key?(:name)
|
66
80
|
@notification_emails = args[:notification_emails] if args.key?(:notification_emails)
|
@@ -296,6 +310,25 @@ module Google
|
|
296
310
|
end
|
297
311
|
end
|
298
312
|
|
313
|
+
# A generic empty message that you can re-use to avoid defining duplicated
|
314
|
+
# empty messages in your APIs. A typical example is to use it as the request
|
315
|
+
# or the response type of an API method. For instance:
|
316
|
+
# service Foo `
|
317
|
+
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
318
|
+
# `
|
319
|
+
# The JSON representation for `Empty` is empty JSON object ````.
|
320
|
+
class Empty
|
321
|
+
include Google::Apis::Core::Hashable
|
322
|
+
|
323
|
+
def initialize(**args)
|
324
|
+
update!(**args)
|
325
|
+
end
|
326
|
+
|
327
|
+
# Update properties of this object
|
328
|
+
def update!(**args)
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
299
332
|
# Represents the enrollment of a cloud resource into a specific service.
|
300
333
|
class EnrolledService
|
301
334
|
include Google::Apis::Core::Hashable
|
@@ -70,6 +70,12 @@ module Google
|
|
70
70
|
include Google::Apis::Core::JsonObjectSupport
|
71
71
|
end
|
72
72
|
|
73
|
+
class Empty
|
74
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
|
+
|
76
|
+
include Google::Apis::Core::JsonObjectSupport
|
77
|
+
end
|
78
|
+
|
73
79
|
class EnrolledService
|
74
80
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
81
|
|
@@ -91,6 +97,7 @@ module Google
|
|
91
97
|
class AccessApprovalSettings
|
92
98
|
# @private
|
93
99
|
class Representation < Google::Apis::Core::JsonRepresentation
|
100
|
+
property :enrolled_ancestor, as: 'enrolledAncestor'
|
94
101
|
collection :enrolled_services, as: 'enrolledServices', class: Google::Apis::AccessapprovalV1beta1::EnrolledService, decorator: Google::Apis::AccessapprovalV1beta1::EnrolledService::Representation
|
95
102
|
|
96
103
|
property :name, as: 'name'
|
@@ -162,6 +169,12 @@ module Google
|
|
162
169
|
end
|
163
170
|
end
|
164
171
|
|
172
|
+
class Empty
|
173
|
+
# @private
|
174
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
165
178
|
class EnrolledService
|
166
179
|
# @private
|
167
180
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -47,6 +47,41 @@ module Google
|
|
47
47
|
@batch_path = 'batch'
|
48
48
|
end
|
49
49
|
|
50
|
+
# Deletes the settings associated with a project, folder, or organization.
|
51
|
+
# This will have the effect of disabling Access Approval for the project,
|
52
|
+
# folder, or organization, but only if all ancestors also have Access
|
53
|
+
# Approval disabled. If Access Approval is enabled at a higher level of the
|
54
|
+
# hierarchy, then Access Approval will still be enabled at this level as
|
55
|
+
# the settings are inherited.
|
56
|
+
# @param [String] name
|
57
|
+
# Name of the AccessApprovalSettings to delete.
|
58
|
+
# @param [String] fields
|
59
|
+
# Selector specifying which fields to include in a partial response.
|
60
|
+
# @param [String] quota_user
|
61
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
62
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
63
|
+
# @param [Google::Apis::RequestOptions] options
|
64
|
+
# Request-specific options
|
65
|
+
#
|
66
|
+
# @yield [result, err] Result & error if block supplied
|
67
|
+
# @yieldparam result [Google::Apis::AccessapprovalV1beta1::Empty] parsed result object
|
68
|
+
# @yieldparam err [StandardError] error object if request failed
|
69
|
+
#
|
70
|
+
# @return [Google::Apis::AccessapprovalV1beta1::Empty]
|
71
|
+
#
|
72
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
73
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
74
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
75
|
+
def delete_folder_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
|
76
|
+
command = make_simple_command(:delete, 'v1beta1/{+name}', options)
|
77
|
+
command.response_representation = Google::Apis::AccessapprovalV1beta1::Empty::Representation
|
78
|
+
command.response_class = Google::Apis::AccessapprovalV1beta1::Empty
|
79
|
+
command.params['name'] = name unless name.nil?
|
80
|
+
command.query['fields'] = fields unless fields.nil?
|
81
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
82
|
+
execute_or_queue_command(command, &block)
|
83
|
+
end
|
84
|
+
|
50
85
|
# Gets the settings associated with a project, folder, or organization.
|
51
86
|
# @param [String] name
|
52
87
|
# Name of the AccessApprovalSettings to retrieve.
|
@@ -88,8 +123,7 @@ module Google
|
|
88
123
|
# <ol>
|
89
124
|
# @param [Google::Apis::AccessapprovalV1beta1::AccessApprovalSettings] access_approval_settings_object
|
90
125
|
# @param [String] update_mask
|
91
|
-
#
|
92
|
-
# see
|
126
|
+
# For the `FieldMask` definition, see
|
93
127
|
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#
|
94
128
|
# fieldmask
|
95
129
|
# If this field is left unset, only the notification_emails field will be
|
@@ -278,6 +312,41 @@ module Google
|
|
278
312
|
execute_or_queue_command(command, &block)
|
279
313
|
end
|
280
314
|
|
315
|
+
# Deletes the settings associated with a project, folder, or organization.
|
316
|
+
# This will have the effect of disabling Access Approval for the project,
|
317
|
+
# folder, or organization, but only if all ancestors also have Access
|
318
|
+
# Approval disabled. If Access Approval is enabled at a higher level of the
|
319
|
+
# hierarchy, then Access Approval will still be enabled at this level as
|
320
|
+
# the settings are inherited.
|
321
|
+
# @param [String] name
|
322
|
+
# Name of the AccessApprovalSettings to delete.
|
323
|
+
# @param [String] fields
|
324
|
+
# Selector specifying which fields to include in a partial response.
|
325
|
+
# @param [String] quota_user
|
326
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
327
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
328
|
+
# @param [Google::Apis::RequestOptions] options
|
329
|
+
# Request-specific options
|
330
|
+
#
|
331
|
+
# @yield [result, err] Result & error if block supplied
|
332
|
+
# @yieldparam result [Google::Apis::AccessapprovalV1beta1::Empty] parsed result object
|
333
|
+
# @yieldparam err [StandardError] error object if request failed
|
334
|
+
#
|
335
|
+
# @return [Google::Apis::AccessapprovalV1beta1::Empty]
|
336
|
+
#
|
337
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
338
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
339
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
340
|
+
def delete_organization_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
|
341
|
+
command = make_simple_command(:delete, 'v1beta1/{+name}', options)
|
342
|
+
command.response_representation = Google::Apis::AccessapprovalV1beta1::Empty::Representation
|
343
|
+
command.response_class = Google::Apis::AccessapprovalV1beta1::Empty
|
344
|
+
command.params['name'] = name unless name.nil?
|
345
|
+
command.query['fields'] = fields unless fields.nil?
|
346
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
347
|
+
execute_or_queue_command(command, &block)
|
348
|
+
end
|
349
|
+
|
281
350
|
# Gets the settings associated with a project, folder, or organization.
|
282
351
|
# @param [String] name
|
283
352
|
# Name of the AccessApprovalSettings to retrieve.
|
@@ -319,8 +388,7 @@ module Google
|
|
319
388
|
# <ol>
|
320
389
|
# @param [Google::Apis::AccessapprovalV1beta1::AccessApprovalSettings] access_approval_settings_object
|
321
390
|
# @param [String] update_mask
|
322
|
-
#
|
323
|
-
# see
|
391
|
+
# For the `FieldMask` definition, see
|
324
392
|
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#
|
325
393
|
# fieldmask
|
326
394
|
# If this field is left unset, only the notification_emails field will be
|
@@ -509,6 +577,41 @@ module Google
|
|
509
577
|
execute_or_queue_command(command, &block)
|
510
578
|
end
|
511
579
|
|
580
|
+
# Deletes the settings associated with a project, folder, or organization.
|
581
|
+
# This will have the effect of disabling Access Approval for the project,
|
582
|
+
# folder, or organization, but only if all ancestors also have Access
|
583
|
+
# Approval disabled. If Access Approval is enabled at a higher level of the
|
584
|
+
# hierarchy, then Access Approval will still be enabled at this level as
|
585
|
+
# the settings are inherited.
|
586
|
+
# @param [String] name
|
587
|
+
# Name of the AccessApprovalSettings to delete.
|
588
|
+
# @param [String] fields
|
589
|
+
# Selector specifying which fields to include in a partial response.
|
590
|
+
# @param [String] quota_user
|
591
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
592
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
593
|
+
# @param [Google::Apis::RequestOptions] options
|
594
|
+
# Request-specific options
|
595
|
+
#
|
596
|
+
# @yield [result, err] Result & error if block supplied
|
597
|
+
# @yieldparam result [Google::Apis::AccessapprovalV1beta1::Empty] parsed result object
|
598
|
+
# @yieldparam err [StandardError] error object if request failed
|
599
|
+
#
|
600
|
+
# @return [Google::Apis::AccessapprovalV1beta1::Empty]
|
601
|
+
#
|
602
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
603
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
604
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
605
|
+
def delete_project_access_approval_settings(name, fields: nil, quota_user: nil, options: nil, &block)
|
606
|
+
command = make_simple_command(:delete, 'v1beta1/{+name}', options)
|
607
|
+
command.response_representation = Google::Apis::AccessapprovalV1beta1::Empty::Representation
|
608
|
+
command.response_class = Google::Apis::AccessapprovalV1beta1::Empty
|
609
|
+
command.params['name'] = name unless name.nil?
|
610
|
+
command.query['fields'] = fields unless fields.nil?
|
611
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
612
|
+
execute_or_queue_command(command, &block)
|
613
|
+
end
|
614
|
+
|
512
615
|
# Gets the settings associated with a project, folder, or organization.
|
513
616
|
# @param [String] name
|
514
617
|
# Name of the AccessApprovalSettings to retrieve.
|
@@ -550,8 +653,7 @@ module Google
|
|
550
653
|
# <ol>
|
551
654
|
# @param [Google::Apis::AccessapprovalV1beta1::AccessApprovalSettings] access_approval_settings_object
|
552
655
|
# @param [String] update_mask
|
553
|
-
#
|
554
|
-
# see
|
656
|
+
# For the `FieldMask` definition, see
|
555
657
|
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#
|
556
658
|
# fieldmask
|
557
659
|
# If this field is left unset, only the notification_emails field will be
|
@@ -25,7 +25,7 @@ module Google
|
|
25
25
|
# @see https://cloud.google.com/access-approval/docs
|
26
26
|
module AccessapprovalV1beta1
|
27
27
|
VERSION = 'V1beta1'
|
28
|
-
REVISION = '
|
28
|
+
REVISION = '20191018'
|
29
29
|
|
30
30
|
# View and manage your data across Google Cloud Platform services
|
31
31
|
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|
@@ -513,7 +513,7 @@ module Google
|
|
513
513
|
|
514
514
|
# Only allows requests from devices with a verified Chrome OS.
|
515
515
|
# Verifications includes requirements that the device is enterprise-managed,
|
516
|
-
# conformant to
|
516
|
+
# conformant to domain policies, and the caller has permission to call
|
517
517
|
# the API targeted by the request.
|
518
518
|
# Corresponds to the JSON property `requireVerifiedChromeOs`
|
519
519
|
# @return [Boolean]
|
@@ -25,7 +25,7 @@ module Google
|
|
25
25
|
# @see https://cloud.google.com/access-context-manager/docs/reference/rest/
|
26
26
|
module AccesscontextmanagerV1
|
27
27
|
VERSION = 'V1'
|
28
|
-
REVISION = '
|
28
|
+
REVISION = '20191012'
|
29
29
|
|
30
30
|
# View and manage your data across Google Cloud Platform services
|
31
31
|
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|