google-api-client 0.10.3 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +12 -18
- data/CHANGELOG.md +22 -2
- data/Gemfile +5 -7
- data/MIGRATING.md +33 -0
- data/README.md +10 -2
- data/Rakefile +1 -0
- data/bin/generate-api +7 -1
- data/dl.rb +0 -0
- data/generated/google/apis/acceleratedmobilepageurl_v1/classes.rb +6 -6
- data/generated/google/apis/acceleratedmobilepageurl_v1/representations.rb +1 -1
- data/generated/google/apis/acceleratedmobilepageurl_v1/service.rb +1 -0
- data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
- data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +759 -759
- data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +152 -152
- data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +376 -375
- data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +58 -58
- data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +45 -45
- data/generated/google/apis/adexchangebuyer_v1_4/service.rb +22 -21
- data/generated/google/apis/adexchangeseller_v2_0/classes.rb +5 -5
- data/generated/google/apis/adexchangeseller_v2_0/representations.rb +5 -5
- data/generated/google/apis/adexchangeseller_v2_0/service.rb +1 -0
- data/generated/google/apis/admin_datatransfer_v1/classes.rb +2 -2
- data/generated/google/apis/admin_datatransfer_v1/representations.rb +2 -2
- data/generated/google/apis/admin_datatransfer_v1/service.rb +2 -1
- data/generated/google/apis/admin_directory_v1/classes.rb +11 -11
- data/generated/google/apis/admin_directory_v1/representations.rb +11 -11
- data/generated/google/apis/admin_directory_v1/service.rb +1 -0
- data/generated/google/apis/admin_reports_v1/classes.rb +5 -5
- data/generated/google/apis/admin_reports_v1/representations.rb +4 -4
- data/generated/google/apis/admin_reports_v1/service.rb +1 -0
- data/generated/google/apis/adsense_v1_4.rb +1 -1
- data/generated/google/apis/adsense_v1_4/classes.rb +2 -2
- data/generated/google/apis/adsense_v1_4/representations.rb +2 -2
- data/generated/google/apis/adsense_v1_4/service.rb +1 -0
- data/generated/google/apis/adsensehost_v4_1.rb +1 -1
- data/generated/google/apis/adsensehost_v4_1/classes.rb +1 -1
- data/generated/google/apis/adsensehost_v4_1/representations.rb +1 -1
- data/generated/google/apis/adsensehost_v4_1/service.rb +1 -0
- data/generated/google/apis/analytics_v3/classes.rb +10 -10
- data/generated/google/apis/analytics_v3/representations.rb +10 -10
- data/generated/google/apis/analytics_v3/service.rb +1 -0
- data/generated/google/apis/analyticsreporting_v4/classes.rb +933 -933
- data/generated/google/apis/analyticsreporting_v4/representations.rb +197 -197
- data/generated/google/apis/analyticsreporting_v4/service.rb +5 -4
- data/generated/google/apis/androidenterprise_v1.rb +1 -1
- data/generated/google/apis/androidenterprise_v1/classes.rb +1 -1
- data/generated/google/apis/androidenterprise_v1/representations.rb +1 -1
- data/generated/google/apis/androidenterprise_v1/service.rb +1 -0
- data/generated/google/apis/androidpublisher_v2/classes.rb +13 -13
- data/generated/google/apis/androidpublisher_v2/representations.rb +13 -13
- data/generated/google/apis/androidpublisher_v2/service.rb +3 -2
- data/generated/google/apis/appengine_v1/classes.rb +2 -2
- data/generated/google/apis/appengine_v1/representations.rb +2 -2
- data/generated/google/apis/appengine_v1/service.rb +1 -0
- data/generated/google/apis/appsactivity_v1/classes.rb +1 -1
- data/generated/google/apis/appsactivity_v1/representations.rb +1 -1
- data/generated/google/apis/appsactivity_v1/service.rb +1 -0
- data/generated/google/apis/appsmarket_v2.rb +35 -0
- data/generated/google/apis/appsmarket_v2/classes.rb +396 -0
- data/generated/google/apis/appsmarket_v2/representations.rb +180 -0
- data/generated/google/apis/appsmarket_v2/service.rb +187 -0
- data/generated/google/apis/appstate_v1.rb +1 -1
- data/generated/google/apis/appstate_v1/service.rb +1 -0
- data/generated/google/apis/bigquery_v2/classes.rb +39 -39
- data/generated/google/apis/bigquery_v2/representations.rb +38 -38
- data/generated/google/apis/bigquery_v2/service.rb +3 -2
- data/generated/google/apis/blogger_v3/classes.rb +2 -2
- data/generated/google/apis/blogger_v3/representations.rb +2 -2
- data/generated/google/apis/blogger_v3/service.rb +1 -0
- data/generated/google/apis/books_v1/classes.rb +5 -5
- data/generated/google/apis/books_v1/representations.rb +4 -4
- data/generated/google/apis/books_v1/service.rb +1 -0
- data/generated/google/apis/calendar_v3/classes.rb +1 -1
- data/generated/google/apis/calendar_v3/representations.rb +1 -1
- data/generated/google/apis/calendar_v3/service.rb +1 -0
- data/generated/google/apis/civicinfo_v2/classes.rb +6 -6
- data/generated/google/apis/civicinfo_v2/representations.rb +6 -6
- data/generated/google/apis/civicinfo_v2/service.rb +2 -1
- data/generated/google/apis/classroom_v1/service.rb +1 -0
- data/generated/google/apis/cloudbilling_v1/service.rb +1 -0
- data/generated/google/apis/cloudbuild_v1.rb +1 -1
- data/generated/google/apis/cloudbuild_v1/classes.rb +626 -626
- data/generated/google/apis/cloudbuild_v1/representations.rb +109 -109
- data/generated/google/apis/cloudbuild_v1/service.rb +159 -158
- data/generated/google/apis/clouddebugger_v2/classes.rb +358 -358
- data/generated/google/apis/clouddebugger_v2/representations.rb +99 -99
- data/generated/google/apis/clouddebugger_v2/service.rb +42 -41
- data/generated/google/apis/clouderrorreporting_v1beta1.rb +1 -1
- data/generated/google/apis/clouderrorreporting_v1beta1/classes.rb +220 -220
- data/generated/google/apis/clouderrorreporting_v1beta1/representations.rb +52 -52
- data/generated/google/apis/clouderrorreporting_v1beta1/service.rb +59 -58
- data/generated/google/apis/cloudfunctions_v1/classes.rb +7 -7
- data/generated/google/apis/cloudfunctions_v1/representations.rb +1 -1
- data/generated/google/apis/cloudfunctions_v1/service.rb +5 -4
- data/generated/google/apis/cloudkms_v1/classes.rb +311 -311
- data/generated/google/apis/cloudkms_v1/representations.rb +87 -87
- data/generated/google/apis/cloudkms_v1/service.rb +168 -167
- data/generated/google/apis/cloudmonitoring_v2beta2/classes.rb +4 -4
- data/generated/google/apis/cloudmonitoring_v2beta2/representations.rb +4 -4
- data/generated/google/apis/cloudmonitoring_v2beta2/service.rb +1 -0
- data/generated/google/apis/cloudresourcemanager_v1.rb +3 -3
- data/generated/google/apis/cloudresourcemanager_v1/classes.rb +341 -341
- data/generated/google/apis/cloudresourcemanager_v1/representations.rb +62 -62
- data/generated/google/apis/cloudresourcemanager_v1/service.rb +458 -457
- data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +327 -327
- data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +71 -71
- data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +237 -236
- data/generated/google/apis/cloudtrace_v1.rb +3 -3
- data/generated/google/apis/cloudtrace_v1/classes.rb +38 -38
- data/generated/google/apis/cloudtrace_v1/representations.rb +13 -13
- data/generated/google/apis/cloudtrace_v1/service.rb +14 -13
- data/generated/google/apis/clouduseraccounts_beta/classes.rb +4 -4
- data/generated/google/apis/clouduseraccounts_beta/representations.rb +4 -4
- data/generated/google/apis/clouduseraccounts_beta/service.rb +1 -0
- data/generated/google/apis/compute_beta/classes.rb +52 -52
- data/generated/google/apis/compute_beta/representations.rb +52 -52
- data/generated/google/apis/compute_beta/service.rb +2 -1
- data/generated/google/apis/compute_v1/classes.rb +48 -48
- data/generated/google/apis/compute_v1/representations.rb +48 -48
- data/generated/google/apis/compute_v1/service.rb +2 -1
- data/generated/google/apis/container_v1/service.rb +1 -0
- data/generated/google/apis/content_v2.rb +1 -1
- data/generated/google/apis/content_v2/classes.rb +38 -660
- data/generated/google/apis/content_v2/representations.rb +37 -303
- data/generated/google/apis/content_v2/service.rb +63 -279
- data/generated/google/apis/customsearch_v1/classes.rb +2 -2
- data/generated/google/apis/customsearch_v1/representations.rb +2 -2
- data/generated/google/apis/customsearch_v1/service.rb +1 -0
- data/generated/google/apis/dataflow_v1b3/classes.rb +3281 -3281
- data/generated/google/apis/dataflow_v1b3/representations.rb +777 -777
- data/generated/google/apis/dataflow_v1b3/service.rb +106 -105
- data/generated/google/apis/dataproc_v1/classes.rb +395 -395
- data/generated/google/apis/dataproc_v1/representations.rb +91 -91
- data/generated/google/apis/dataproc_v1/service.rb +356 -355
- data/generated/google/apis/datastore_v1/classes.rb +506 -506
- data/generated/google/apis/datastore_v1/representations.rb +147 -147
- data/generated/google/apis/datastore_v1/service.rb +46 -45
- data/generated/google/apis/deploymentmanager_v2/classes.rb +6 -6
- data/generated/google/apis/deploymentmanager_v2/representations.rb +6 -6
- data/generated/google/apis/deploymentmanager_v2/service.rb +1 -0
- data/generated/google/apis/dfareporting_v2_6/classes.rb +280 -280
- data/generated/google/apis/dfareporting_v2_6/representations.rb +266 -266
- data/generated/google/apis/dfareporting_v2_6/service.rb +421 -420
- data/generated/google/apis/dfareporting_v2_7/classes.rb +280 -280
- data/generated/google/apis/dfareporting_v2_7/representations.rb +266 -266
- data/generated/google/apis/dfareporting_v2_7/service.rb +423 -422
- data/generated/google/apis/discovery_v1/service.rb +1 -0
- data/generated/google/apis/dns_v1/classes.rb +2 -2
- data/generated/google/apis/dns_v1/representations.rb +2 -2
- data/generated/google/apis/dns_v1/service.rb +1 -0
- data/generated/google/apis/dns_v2beta1/classes.rb +2 -2
- data/generated/google/apis/dns_v2beta1/representations.rb +2 -2
- data/generated/google/apis/dns_v2beta1/service.rb +1 -0
- data/generated/google/apis/doubleclickbidmanager_v1/classes.rb +15 -15
- data/generated/google/apis/doubleclickbidmanager_v1/representations.rb +13 -13
- data/generated/google/apis/doubleclickbidmanager_v1/service.rb +5 -4
- data/generated/google/apis/doubleclicksearch_v2/classes.rb +28 -28
- data/generated/google/apis/doubleclicksearch_v2/representations.rb +28 -28
- data/generated/google/apis/doubleclicksearch_v2/service.rb +13 -12
- data/generated/google/apis/drive_v2/classes.rb +17 -17
- data/generated/google/apis/drive_v2/representations.rb +17 -17
- data/generated/google/apis/drive_v2/service.rb +5 -4
- data/generated/google/apis/drive_v3/classes.rb +13 -13
- data/generated/google/apis/drive_v3/representations.rb +12 -12
- data/generated/google/apis/drive_v3/service.rb +1 -0
- data/generated/google/apis/firebasedynamiclinks_v1.rb +1 -1
- data/generated/google/apis/firebasedynamiclinks_v1/classes.rb +81 -81
- data/generated/google/apis/firebasedynamiclinks_v1/representations.rb +24 -24
- data/generated/google/apis/firebasedynamiclinks_v1/service.rb +1 -0
- data/generated/google/apis/firebaserules_v1/classes.rb +201 -201
- data/generated/google/apis/firebaserules_v1/representations.rb +61 -61
- data/generated/google/apis/firebaserules_v1/service.rb +1 -0
- data/generated/google/apis/fitness_v1/classes.rb +18 -18
- data/generated/google/apis/fitness_v1/representations.rb +18 -18
- data/generated/google/apis/fitness_v1/service.rb +6 -5
- data/generated/google/apis/fusiontables_v2/classes.rb +2 -2
- data/generated/google/apis/fusiontables_v2/representations.rb +2 -2
- data/generated/google/apis/fusiontables_v2/service.rb +1 -0
- data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
- data/generated/google/apis/games_configuration_v1configuration/classes.rb +2 -2
- data/generated/google/apis/games_configuration_v1configuration/representations.rb +2 -2
- data/generated/google/apis/games_configuration_v1configuration/service.rb +1 -0
- data/generated/google/apis/games_management_v1management.rb +1 -1
- data/generated/google/apis/games_management_v1management/classes.rb +6 -6
- data/generated/google/apis/games_management_v1management/representations.rb +6 -6
- data/generated/google/apis/games_management_v1management/service.rb +1 -0
- data/generated/google/apis/games_v1.rb +1 -1
- data/generated/google/apis/games_v1/classes.rb +47 -47
- data/generated/google/apis/games_v1/representations.rb +47 -47
- data/generated/google/apis/games_v1/service.rb +58 -57
- data/generated/google/apis/genomics_v1.rb +6 -6
- data/generated/google/apis/genomics_v1/classes.rb +2354 -2354
- data/generated/google/apis/genomics_v1/representations.rb +487 -487
- data/generated/google/apis/genomics_v1/service.rb +1188 -1187
- data/generated/google/apis/gmail_v1/classes.rb +11 -11
- data/generated/google/apis/gmail_v1/representations.rb +11 -11
- data/generated/google/apis/gmail_v1/service.rb +2 -1
- data/generated/google/apis/groupsmigration_v1/service.rb +1 -0
- data/generated/google/apis/groupssettings_v1/service.rb +1 -0
- data/generated/google/apis/iam_v1/classes.rb +437 -437
- data/generated/google/apis/iam_v1/representations.rb +95 -95
- data/generated/google/apis/iam_v1/service.rb +87 -86
- data/generated/google/apis/identitytoolkit_v3/classes.rb +20 -20
- data/generated/google/apis/identitytoolkit_v3/representations.rb +20 -20
- data/generated/google/apis/identitytoolkit_v3/service.rb +1 -0
- data/generated/google/apis/kgsearch_v1/service.rb +9 -8
- data/generated/google/apis/language_v1.rb +1 -1
- data/generated/google/apis/language_v1/classes.rb +245 -245
- data/generated/google/apis/language_v1/representations.rb +65 -65
- data/generated/google/apis/language_v1/service.rb +1 -0
- data/generated/google/apis/language_v1beta1.rb +1 -1
- data/generated/google/apis/language_v1beta1/classes.rb +277 -277
- data/generated/google/apis/language_v1beta1/representations.rb +83 -83
- data/generated/google/apis/language_v1beta1/service.rb +31 -30
- data/generated/google/apis/licensing_v1/service.rb +1 -0
- data/generated/google/apis/logging_v2/classes.rb +408 -408
- data/generated/google/apis/logging_v2/representations.rb +93 -93
- data/generated/google/apis/logging_v2/service.rb +408 -407
- data/generated/google/apis/logging_v2beta1.rb +3 -3
- data/generated/google/apis/logging_v2beta1/classes.rb +892 -892
- data/generated/google/apis/logging_v2beta1/representations.rb +128 -128
- data/generated/google/apis/logging_v2beta1/service.rb +89 -88
- data/generated/google/apis/manufacturers_v1/classes.rb +309 -309
- data/generated/google/apis/manufacturers_v1/representations.rb +64 -64
- data/generated/google/apis/manufacturers_v1/service.rb +1 -0
- data/generated/google/apis/mirror_v1/service.rb +1 -0
- data/generated/google/apis/ml_v1/classes.rb +1185 -1185
- data/generated/google/apis/ml_v1/representations.rb +171 -171
- data/generated/google/apis/ml_v1/service.rb +282 -281
- data/generated/google/apis/monitoring_v3.rb +3 -3
- data/generated/google/apis/monitoring_v3/classes.rb +334 -334
- data/generated/google/apis/monitoring_v3/representations.rb +86 -86
- data/generated/google/apis/monitoring_v3/service.rb +344 -343
- data/generated/google/apis/mybusiness_v3/service.rb +1 -0
- data/generated/google/apis/oauth2_v2/service.rb +1 -0
- data/generated/google/apis/pagespeedonline_v2/classes.rb +8 -8
- data/generated/google/apis/pagespeedonline_v2/representations.rb +8 -8
- data/generated/google/apis/pagespeedonline_v2/service.rb +1 -0
- data/generated/google/apis/partners_v2/classes.rb +1466 -1466
- data/generated/google/apis/partners_v2/representations.rb +371 -371
- data/generated/google/apis/partners_v2/service.rb +530 -529
- data/generated/google/apis/people_v1.rb +4 -4
- data/generated/google/apis/people_v1/classes.rb +1009 -1009
- data/generated/google/apis/people_v1/representations.rb +249 -249
- data/generated/google/apis/people_v1/service.rb +13 -12
- data/generated/google/apis/plus_domains_v1/classes.rb +2 -2
- data/generated/google/apis/plus_domains_v1/representations.rb +2 -2
- data/generated/google/apis/plus_domains_v1/service.rb +1 -0
- data/generated/google/apis/plus_v1/service.rb +1 -0
- data/generated/google/apis/prediction_v1_6/classes.rb +9 -9
- data/generated/google/apis/prediction_v1_6/representations.rb +9 -9
- data/generated/google/apis/prediction_v1_6/service.rb +1 -0
- data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +221 -221
- data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +55 -55
- data/generated/google/apis/proximitybeacon_v1beta1/service.rb +378 -377
- data/generated/google/apis/pubsub_v1/classes.rb +99 -99
- data/generated/google/apis/pubsub_v1/representations.rb +25 -25
- data/generated/google/apis/pubsub_v1/service.rb +236 -235
- data/generated/google/apis/qpx_express_v1/service.rb +1 -0
- data/generated/google/apis/replicapool_v1beta2/classes.rb +3 -3
- data/generated/google/apis/replicapool_v1beta2/representations.rb +3 -3
- data/generated/google/apis/replicapool_v1beta2/service.rb +1 -0
- data/generated/google/apis/replicapoolupdater_v1beta1/classes.rb +2 -2
- data/generated/google/apis/replicapoolupdater_v1beta1/representations.rb +2 -2
- data/generated/google/apis/replicapoolupdater_v1beta1/service.rb +1 -0
- data/generated/google/apis/reseller_v1/classes.rb +5 -5
- data/generated/google/apis/reseller_v1/representations.rb +5 -5
- data/generated/google/apis/reseller_v1/service.rb +1 -0
- data/generated/google/apis/resourceviews_v1beta2/classes.rb +2 -2
- data/generated/google/apis/resourceviews_v1beta2/representations.rb +2 -2
- data/generated/google/apis/resourceviews_v1beta2/service.rb +1 -0
- data/generated/google/apis/runtimeconfig_v1.rb +3 -3
- data/generated/google/apis/runtimeconfig_v1/classes.rb +28 -28
- data/generated/google/apis/runtimeconfig_v1/representations.rb +3 -3
- data/generated/google/apis/runtimeconfig_v1/service.rb +53 -52
- data/generated/google/apis/script_v1.rb +18 -18
- data/generated/google/apis/script_v1/classes.rb +84 -84
- data/generated/google/apis/script_v1/representations.rb +18 -18
- data/generated/google/apis/script_v1/service.rb +11 -10
- data/generated/google/apis/searchconsole_v1/classes.rb +75 -75
- data/generated/google/apis/searchconsole_v1/representations.rb +32 -32
- data/generated/google/apis/searchconsole_v1/service.rb +11 -10
- data/generated/google/apis/servicecontrol_v1/classes.rb +582 -582
- data/generated/google/apis/servicecontrol_v1/representations.rb +113 -113
- data/generated/google/apis/servicecontrol_v1/service.rb +71 -70
- data/generated/google/apis/servicemanagement_v1.rb +3 -3
- data/generated/google/apis/servicemanagement_v1/classes.rb +3725 -3725
- data/generated/google/apis/servicemanagement_v1/representations.rb +255 -255
- data/generated/google/apis/servicemanagement_v1/service.rb +179 -178
- data/generated/google/apis/serviceuser_v1.rb +3 -3
- data/generated/google/apis/serviceuser_v1/classes.rb +2845 -2845
- data/generated/google/apis/serviceuser_v1/representations.rb +228 -228
- data/generated/google/apis/serviceuser_v1/service.rb +47 -46
- data/generated/google/apis/sheets_v4.rb +1 -1
- data/generated/google/apis/sheets_v4/classes.rb +4456 -4456
- data/generated/google/apis/sheets_v4/representations.rb +859 -859
- data/generated/google/apis/sheets_v4/service.rb +180 -179
- data/generated/google/apis/site_verification_v1/service.rb +1 -0
- data/generated/google/apis/slides_v1.rb +1 -1
- data/generated/google/apis/slides_v1/classes.rb +2856 -2856
- data/generated/google/apis/slides_v1/representations.rb +683 -683
- data/generated/google/apis/slides_v1/service.rb +27 -26
- data/generated/google/apis/sourcerepo_v1/classes.rb +281 -281
- data/generated/google/apis/sourcerepo_v1/representations.rb +79 -79
- data/generated/google/apis/sourcerepo_v1/service.rb +112 -111
- data/generated/google/apis/spanner_v1/classes.rb +2177 -2177
- data/generated/google/apis/spanner_v1/representations.rb +325 -325
- data/generated/google/apis/spanner_v1/service.rb +374 -373
- data/generated/google/apis/speech_v1beta1/classes.rb +197 -197
- data/generated/google/apis/speech_v1beta1/representations.rb +36 -36
- data/generated/google/apis/speech_v1beta1/service.rb +27 -26
- data/generated/google/apis/sqladmin_v1beta4/classes.rb +14 -14
- data/generated/google/apis/sqladmin_v1beta4/representations.rb +14 -14
- data/generated/google/apis/sqladmin_v1beta4/service.rb +3 -2
- data/generated/google/apis/storage_v1.rb +1 -1
- data/generated/google/apis/storage_v1/classes.rb +11 -11
- data/generated/google/apis/storage_v1/representations.rb +11 -11
- data/generated/google/apis/storage_v1/service.rb +65 -64
- data/generated/google/apis/storagetransfer_v1/classes.rb +239 -239
- data/generated/google/apis/storagetransfer_v1/representations.rb +79 -79
- data/generated/google/apis/storagetransfer_v1/service.rb +133 -132
- data/generated/google/apis/surveys_v2/classes.rb +4 -4
- data/generated/google/apis/surveys_v2/representations.rb +4 -4
- data/generated/google/apis/surveys_v2/service.rb +1 -0
- data/generated/google/apis/tagmanager_v1/classes.rb +7 -7
- data/generated/google/apis/tagmanager_v1/representations.rb +7 -7
- data/generated/google/apis/tagmanager_v1/service.rb +1 -0
- data/generated/google/apis/tagmanager_v2/classes.rb +6 -6
- data/generated/google/apis/tagmanager_v2/representations.rb +6 -6
- data/generated/google/apis/tagmanager_v2/service.rb +1 -0
- data/generated/google/apis/taskqueue_v1beta2/classes.rb +5 -5
- data/generated/google/apis/taskqueue_v1beta2/representations.rb +5 -5
- data/generated/google/apis/taskqueue_v1beta2/service.rb +1 -0
- data/generated/google/apis/tasks_v1/service.rb +3 -2
- data/generated/google/apis/toolresults_v1beta3.rb +1 -1
- data/generated/google/apis/toolresults_v1beta3/classes.rb +4 -4
- data/generated/google/apis/toolresults_v1beta3/representations.rb +4 -4
- data/generated/google/apis/toolresults_v1beta3/service.rb +1 -0
- data/generated/google/apis/tracing_v1/classes.rb +421 -421
- data/generated/google/apis/tracing_v1/representations.rb +86 -86
- data/generated/google/apis/tracing_v1/service.rb +60 -59
- data/generated/google/apis/translate_v2/service.rb +1 -0
- data/generated/google/apis/urlshortener_v1/classes.rb +3 -3
- data/generated/google/apis/urlshortener_v1/representations.rb +3 -3
- data/generated/google/apis/urlshortener_v1/service.rb +1 -0
- data/generated/google/apis/vision_v1/classes.rb +1290 -1290
- data/generated/google/apis/vision_v1/representations.rb +184 -184
- data/generated/google/apis/vision_v1/service.rb +11 -10
- data/generated/google/apis/webfonts_v1/service.rb +1 -0
- data/generated/google/apis/webmasters_v3/classes.rb +5 -5
- data/generated/google/apis/webmasters_v3/representations.rb +5 -5
- data/generated/google/apis/webmasters_v3/service.rb +1 -0
- data/generated/google/apis/youtube_analytics_v1/classes.rb +1 -1
- data/generated/google/apis/youtube_analytics_v1/representations.rb +1 -1
- data/generated/google/apis/youtube_analytics_v1/service.rb +1 -0
- data/generated/google/apis/youtube_partner_v1/classes.rb +13 -13
- data/generated/google/apis/youtube_partner_v1/representations.rb +13 -13
- data/generated/google/apis/youtube_partner_v1/service.rb +1 -0
- data/generated/google/apis/youtube_v3/classes.rb +31 -31
- data/generated/google/apis/youtube_v3/representations.rb +31 -31
- data/generated/google/apis/youtube_v3/service.rb +2 -1
- data/generated/google/apis/youtubereporting_v1.rb +4 -4
- data/generated/google/apis/youtubereporting_v1/classes.rb +73 -73
- data/generated/google/apis/youtubereporting_v1/representations.rb +18 -18
- data/generated/google/apis/youtubereporting_v1/service.rb +77 -76
- data/google-api-client.gemspec +4 -6
- data/lib/google/apis/core/api_command.rb +8 -3
- data/lib/google/apis/core/base_service.rb +47 -18
- data/lib/google/apis/core/batch.rb +13 -18
- data/lib/google/apis/core/composite_io.rb +97 -0
- data/lib/google/apis/core/download.rb +24 -20
- data/lib/google/apis/core/http_command.rb +49 -38
- data/lib/google/apis/core/json_representation.rb +5 -1
- data/lib/google/apis/core/multipart.rb +43 -95
- data/lib/google/apis/core/upload.rb +59 -84
- data/lib/google/apis/generator/model.rb +2 -0
- data/lib/google/apis/generator/templates/_representation.tmpl +1 -1
- data/lib/google/apis/generator/templates/service.rb.tmpl +1 -0
- data/lib/google/apis/options.rb +24 -12
- data/lib/google/apis/version.rb +1 -1
- data/samples/web/Gemfile +0 -1
- metadata +39 -37
- data/lib/google/apis/core/http_client_adapter.rb +0 -82
- data/third_party/hurley_patches.rb +0 -103
@@ -51,6 +51,8 @@ module Google
|
|
51
51
|
when 'string', 'boolean', 'number', 'integer', 'any'
|
52
52
|
return 'DateTime' if format == 'date-time'
|
53
53
|
return 'Date' if format == 'date'
|
54
|
+
return 'Fixnum' if format == 'int64'
|
55
|
+
return 'Fixnum' if format == 'uint64'
|
54
56
|
return TYPE_MAP[type]
|
55
57
|
when 'array'
|
56
58
|
return sprintf('Array<%s>', items.generated_type)
|
@@ -33,7 +33,7 @@ class <%= cls.generated_class_name %>
|
|
33
33
|
<% elsif property.type == 'array' -%>
|
34
34
|
collection :<%= property.generated_name %>, as: '<%= property.name %>'<%= include('representation_type', :lead => ', ', :type => property.items, :api => api) %>
|
35
35
|
<% else -%>
|
36
|
-
property :<%= property.generated_name %>,<% if property.format == 'byte' %> :base64 => true,<%end%> as: '<%= property.name %>'<%= include('representation_type', :lead => ', ', :type => property, :api => api) %>
|
36
|
+
property :<%= property.generated_name %>,<% if ['uint64', 'int64'].include?(property.format) %> :numeric_string => true,<%end%><% if property.format == 'byte' %> :base64 => true,<%end%> as: '<%= property.name %>'<%= include('representation_type', :lead => ', ', :type => property, :api => api) %>
|
37
37
|
<% end -%>
|
38
38
|
<% end -%>
|
39
39
|
<% end -%>
|
@@ -42,6 +42,7 @@ module Google
|
|
42
42
|
<% end -%>
|
43
43
|
def initialize
|
44
44
|
super('<%= api.root_url %>', '<%= api.service_path %>')
|
45
|
+
@batch_path = '<%= api.batch_path %>'
|
45
46
|
end
|
46
47
|
<% for api_method in api.all_methods -%>
|
47
48
|
<%= indent(include('method', :api_method => api_method, :api => api), 8) -%>
|
data/lib/google/apis/options.rb
CHANGED
@@ -15,18 +15,22 @@
|
|
15
15
|
module Google
|
16
16
|
module Apis
|
17
17
|
# General options for API requests
|
18
|
-
ClientOptions =
|
18
|
+
ClientOptions = Struct.new(
|
19
19
|
:application_name,
|
20
20
|
:application_version,
|
21
21
|
:proxy_url,
|
22
|
-
:
|
22
|
+
:open_timeout_sec,
|
23
|
+
:read_timeout_sec,
|
24
|
+
:send_timeout_sec,
|
25
|
+
:log_http_requests)
|
23
26
|
|
24
27
|
RequestOptions = Struct.new(
|
25
28
|
:authorization,
|
26
29
|
:retries,
|
27
30
|
:header,
|
28
|
-
:
|
29
|
-
:
|
31
|
+
:normalize_unicode,
|
32
|
+
:skip_serialization,
|
33
|
+
:skip_deserialization)
|
30
34
|
|
31
35
|
# General client options
|
32
36
|
class ClientOptions
|
@@ -36,7 +40,12 @@ module Google
|
|
36
40
|
# @return [String] Version of the application, for identification in the User-Agent header
|
37
41
|
# @!attribute [rw] proxy_url
|
38
42
|
# @return [String] URL of a proxy server
|
39
|
-
|
43
|
+
# @!attribute [rw] log_http_requests
|
44
|
+
# @return [Boolean] True if raw HTTP requests should be logged
|
45
|
+
# @!attribute [rw] open_timeout_sec
|
46
|
+
# @return [Fixnum] How long, in seconds, before failed connections time out
|
47
|
+
# @!attribute [rw] read_timeout_sec
|
48
|
+
# @return [Fixnum] How long, in seconds, before requests time out
|
40
49
|
# Get the default options
|
41
50
|
# @return [Google::Apis::ClientOptions]
|
42
51
|
def self.default
|
@@ -50,12 +59,14 @@ module Google
|
|
50
59
|
# @return [Signet::OAuth2::Client, #apply(Hash)] OAuth2 credentials
|
51
60
|
# @!attribute [rw] retries
|
52
61
|
# @return [Fixnum] Number of times to retry requests on server error
|
53
|
-
# @!attribute [rw] timeout_sec
|
54
|
-
# @return [Fixnum] How long, in seconds, before requests time out
|
55
|
-
# @!attribute [rw] open_timeout_sec
|
56
|
-
# @return [Fixnum] How long, in seconds, before failed connections time out
|
57
62
|
# @!attribute [rw] header
|
58
63
|
# @return [Hash<String,String] Additional HTTP headers to include in requests
|
64
|
+
# @!attribute [rw] normalize_unicode
|
65
|
+
# @return [Boolean] True if unicode strings should be normalized in path parameters
|
66
|
+
# @!attribute [rw] skip_serialization
|
67
|
+
# @return [Boolean] True if body object should be treated as raw text instead of an object.
|
68
|
+
# @!attribute [rw] skip_deserialization
|
69
|
+
# @return [Boolean] True if response should be returned in raw form instead of deserialized.
|
59
70
|
|
60
71
|
# Get the default options
|
61
72
|
# @return [Google::Apis::RequestOptions]
|
@@ -75,11 +86,12 @@ module Google
|
|
75
86
|
end
|
76
87
|
end
|
77
88
|
|
78
|
-
ClientOptions.default.
|
89
|
+
ClientOptions.default.log_http_requests = false
|
79
90
|
ClientOptions.default.application_name = 'unknown'
|
80
91
|
ClientOptions.default.application_version = '0.0.0'
|
81
|
-
|
82
92
|
RequestOptions.default.retries = 0
|
83
|
-
RequestOptions.default.
|
93
|
+
RequestOptions.default.normalize_unicode = false
|
94
|
+
RequestOptions.default.skip_serialization = false
|
95
|
+
RequestOptions.default.skip_deserialization = false
|
84
96
|
end
|
85
97
|
end
|
data/lib/google/apis/version.rb
CHANGED
data/samples/web/Gemfile
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Bazyl
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-03
|
14
|
+
date: 2017-04-03 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: representable
|
@@ -51,44 +51,30 @@ dependencies:
|
|
51
51
|
name: addressable
|
52
52
|
requirement: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - "
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
56
|
+
version: 2.5.1
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - "
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
63
|
+
version: 2.5.1
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: mime-types
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: '
|
70
|
+
version: '3.0'
|
71
71
|
type: :runtime
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: hurley
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
requirements:
|
82
|
-
- - "~>"
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: '0.1'
|
85
|
-
type: :runtime
|
86
|
-
prerelease: false
|
87
|
-
version_requirements: !ruby/object:Gem::Requirement
|
88
|
-
requirements:
|
89
|
-
- - "~>"
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: '0.1'
|
77
|
+
version: '3.0'
|
92
78
|
- !ruby/object:Gem::Dependency
|
93
79
|
name: googleauth
|
94
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,44 +93,56 @@ dependencies:
|
|
107
93
|
name: httpclient
|
108
94
|
requirement: !ruby/object:Gem::Requirement
|
109
95
|
requirements:
|
110
|
-
- - "
|
96
|
+
- - ">="
|
111
97
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
98
|
+
version: 2.8.1
|
99
|
+
- - "<"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '3.0'
|
113
102
|
type: :runtime
|
114
103
|
prerelease: false
|
115
104
|
version_requirements: !ruby/object:Gem::Requirement
|
116
105
|
requirements:
|
117
|
-
- - "
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 2.8.1
|
109
|
+
- - "<"
|
118
110
|
- !ruby/object:Gem::Version
|
119
|
-
version: '
|
111
|
+
version: '3.0'
|
120
112
|
- !ruby/object:Gem::Dependency
|
121
|
-
name:
|
113
|
+
name: thor
|
122
114
|
requirement: !ruby/object:Gem::Requirement
|
123
115
|
requirements:
|
124
116
|
- - "~>"
|
125
117
|
- !ruby/object:Gem::Version
|
126
|
-
version: '0.
|
127
|
-
type: :
|
118
|
+
version: '0.19'
|
119
|
+
type: :development
|
128
120
|
prerelease: false
|
129
121
|
version_requirements: !ruby/object:Gem::Requirement
|
130
122
|
requirements:
|
131
123
|
- - "~>"
|
132
124
|
- !ruby/object:Gem::Version
|
133
|
-
version: '0.
|
125
|
+
version: '0.19'
|
134
126
|
- !ruby/object:Gem::Dependency
|
135
|
-
name:
|
127
|
+
name: activesupport
|
136
128
|
requirement: !ruby/object:Gem::Requirement
|
137
129
|
requirements:
|
138
|
-
- - "
|
130
|
+
- - ">="
|
139
131
|
- !ruby/object:Gem::Version
|
140
|
-
version: '
|
132
|
+
version: '4.2'
|
133
|
+
- - "<"
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '5.1'
|
141
136
|
type: :development
|
142
137
|
prerelease: false
|
143
138
|
version_requirements: !ruby/object:Gem::Requirement
|
144
139
|
requirements:
|
145
|
-
- - "
|
140
|
+
- - ">="
|
146
141
|
- !ruby/object:Gem::Version
|
147
|
-
version: '
|
142
|
+
version: '4.2'
|
143
|
+
- - "<"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '5.1'
|
148
146
|
description:
|
149
147
|
email:
|
150
148
|
- sbazyl@google.com
|
@@ -168,6 +166,7 @@ files:
|
|
168
166
|
- Rakefile
|
169
167
|
- api_names.yaml
|
170
168
|
- bin/generate-api
|
169
|
+
- dl.rb
|
171
170
|
- generated/google/apis/acceleratedmobilepageurl_v1.rb
|
172
171
|
- generated/google/apis/acceleratedmobilepageurl_v1/classes.rb
|
173
172
|
- generated/google/apis/acceleratedmobilepageurl_v1/representations.rb
|
@@ -240,6 +239,10 @@ files:
|
|
240
239
|
- generated/google/apis/appsactivity_v1/classes.rb
|
241
240
|
- generated/google/apis/appsactivity_v1/representations.rb
|
242
241
|
- generated/google/apis/appsactivity_v1/service.rb
|
242
|
+
- generated/google/apis/appsmarket_v2.rb
|
243
|
+
- generated/google/apis/appsmarket_v2/classes.rb
|
244
|
+
- generated/google/apis/appsmarket_v2/representations.rb
|
245
|
+
- generated/google/apis/appsmarket_v2/service.rb
|
243
246
|
- generated/google/apis/appstate_v1.rb
|
244
247
|
- generated/google/apis/appstate_v1/classes.rb
|
245
248
|
- generated/google/apis/appstate_v1/representations.rb
|
@@ -740,9 +743,9 @@ files:
|
|
740
743
|
- lib/google/apis/core/api_command.rb
|
741
744
|
- lib/google/apis/core/base_service.rb
|
742
745
|
- lib/google/apis/core/batch.rb
|
746
|
+
- lib/google/apis/core/composite_io.rb
|
743
747
|
- lib/google/apis/core/download.rb
|
744
748
|
- lib/google/apis/core/hashable.rb
|
745
|
-
- lib/google/apis/core/http_client_adapter.rb
|
746
749
|
- lib/google/apis/core/http_command.rb
|
747
750
|
- lib/google/apis/core/json_representation.rb
|
748
751
|
- lib/google/apis/core/logging.rb
|
@@ -794,7 +797,6 @@ files:
|
|
794
797
|
- samples/web/views/drive.erb
|
795
798
|
- samples/web/views/home.erb
|
796
799
|
- samples/web/views/layout.erb
|
797
|
-
- third_party/hurley_patches.rb
|
798
800
|
homepage: https://github.com/google/google-api-ruby-client
|
799
801
|
licenses:
|
800
802
|
- Apache 2.0
|
@@ -1,82 +0,0 @@
|
|
1
|
-
require 'httpclient'
|
2
|
-
require 'hurley'
|
3
|
-
require 'hurley/client'
|
4
|
-
|
5
|
-
module Google
|
6
|
-
module Apis
|
7
|
-
module Core
|
8
|
-
# HTTPClient adapter for Hurley.
|
9
|
-
class HttpClientAdapter
|
10
|
-
|
11
|
-
def call(request)
|
12
|
-
client = ::HTTPClient.new
|
13
|
-
configure_client(client, request)
|
14
|
-
|
15
|
-
begin
|
16
|
-
::Hurley::Response.new(request) do |res|
|
17
|
-
http_res = client.request(request.verb.to_s.upcase, request.url.to_s, nil, request.body_io, request.header.to_hash, false) do |http_res, chunk|
|
18
|
-
copy_response(http_res, res)
|
19
|
-
res.receive_body(chunk)
|
20
|
-
end
|
21
|
-
copy_response(http_res, res)
|
22
|
-
end
|
23
|
-
rescue ::HTTPClient::TimeoutError, Errno::ETIMEDOUT
|
24
|
-
raise ::Hurley::Timeout, $!
|
25
|
-
rescue ::HTTPClient::BadResponseError => err
|
26
|
-
if err.message.include?('status 407')
|
27
|
-
raise ::Hurley::ConnectionFailed, %{407 "Proxy Authentication Required "}
|
28
|
-
else
|
29
|
-
raise Hurley::ClientError, $!
|
30
|
-
end
|
31
|
-
rescue Errno::ECONNREFUSED, EOFError
|
32
|
-
raise ::Hurley::ConnectionFailed, $!
|
33
|
-
rescue => err
|
34
|
-
if defined?(OpenSSL) && OpenSSL::SSL::SSLError === err
|
35
|
-
raise Hurley::SSLError, err
|
36
|
-
else
|
37
|
-
raise
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def copy_response(http_res, res)
|
43
|
-
unless res.status_code
|
44
|
-
res.status_code = http_res.status.to_i
|
45
|
-
http_res.header.all.each do |(k,v)|
|
46
|
-
res.header[k] = v
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def configure_client(client, request)
|
52
|
-
client.transparent_gzip_decompression = true
|
53
|
-
if request.options.proxy
|
54
|
-
proxy = request.options.proxy
|
55
|
-
client.proxy = sprintf('%s:%d', proxy.host, proxy.port)
|
56
|
-
if proxy.user && proxy.password
|
57
|
-
client.set_proxy_auth proxy.user, proxy.password
|
58
|
-
end
|
59
|
-
end
|
60
|
-
if request.options.timeout
|
61
|
-
client.connect_timeout = request.options.timeout
|
62
|
-
client.receive_timeout = request.options.timeout
|
63
|
-
client.send_timeout = request.options.timeout
|
64
|
-
end
|
65
|
-
if request.options.open_timeout
|
66
|
-
client.connect_timeout = request.options.open_timeout
|
67
|
-
client.send_timeout = request.options.open_timeout
|
68
|
-
end
|
69
|
-
ssl_config = client.ssl_config
|
70
|
-
ssl_opts = request.ssl_options
|
71
|
-
ssl_config.verify_mode = ssl_opts.openssl_verify_mode
|
72
|
-
ssl_config.cert_store = ssl_opts.openssl_cert_store
|
73
|
-
ssl_config.add_trust_ca ssl_opts.ca_file if ssl_opts.ca_file
|
74
|
-
ssl_config.add_trust_ca ssl_opts.ca_path if ssl_opts.ca_path
|
75
|
-
ssl_config.client_cert = ssl_opts.openssl_client_cert if ssl_opts.openssl_client_cert
|
76
|
-
ssl_config.client_key = ssl_opts.openssl_client_key if ssl_opts.openssl_client_key
|
77
|
-
ssl_config.verify_depth = ssl_opts.verify_depth if ssl_opts.verify_depth
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
@@ -1,103 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2015 Rick Olson
|
3
|
-
#
|
4
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
-
# of this software and associated documentation files (the "Software"), to deal
|
6
|
-
# in the Software without restriction, including without limitation the rights
|
7
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
-
# copies of the Software, and to permit persons to whom the Software is
|
9
|
-
# furnished to do so, subject to the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be included in all
|
12
|
-
# copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
-
# SOFTWARE.
|
21
|
-
#
|
22
|
-
require 'hurley'
|
23
|
-
require 'hurley/client'
|
24
|
-
require 'hurley/connection'
|
25
|
-
require 'net/https'
|
26
|
-
|
27
|
-
# Temporary monkey patch for streaming downloads. These are fixed in HEAD,
|
28
|
-
# but pending a 0.3 release.
|
29
|
-
if Hurley::VERSION == '0.2'
|
30
|
-
module Hurley
|
31
|
-
class Response
|
32
|
-
def location
|
33
|
-
@location ||= begin
|
34
|
-
return unless loc = @header[:location]
|
35
|
-
verb = STATUS_FORCE_GET.include?(status_code) ? :get : request.verb
|
36
|
-
statuses, receiver = request.send(:body_receiver)
|
37
|
-
new_request = Request.new(verb, request.url.join(Url.parse(loc)), request.header, request.body, request.options, request.ssl_options)
|
38
|
-
new_request.on_body(*statuses, &receiver) unless receiver.is_a?(Hurley::BodyReceiver)
|
39
|
-
new_request
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
class Connection
|
45
|
-
def call(request)
|
46
|
-
net_http_connection(request) do |http|
|
47
|
-
begin
|
48
|
-
Response.new(request) do |res|
|
49
|
-
perform_request(http, request, res)
|
50
|
-
|
51
|
-
# net/http only raises exception on 407 with ssl...?
|
52
|
-
if res.status_code == 407
|
53
|
-
raise ConnectionFailed, %(407 "Proxy Authentication Required")
|
54
|
-
end
|
55
|
-
end
|
56
|
-
rescue *NET_HTTP_EXCEPTIONS => err
|
57
|
-
if defined?(OpenSSL) && OpenSSL::SSL::SSLError === err
|
58
|
-
raise SSLError, err
|
59
|
-
else
|
60
|
-
raise ConnectionFailed, err
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
rescue ::Timeout::Error => err
|
66
|
-
raise Timeout, err
|
67
|
-
end
|
68
|
-
|
69
|
-
private
|
70
|
-
|
71
|
-
def net_http_request(request)
|
72
|
-
http_req = Net::HTTPGenericRequest.new(
|
73
|
-
request.verb.to_s.upcase, # request method
|
74
|
-
!!request.body, # is there a request body
|
75
|
-
:head != request.verb, # is there a response body
|
76
|
-
request.url.request_uri, # request uri path
|
77
|
-
request.header, # request headers
|
78
|
-
)
|
79
|
-
|
80
|
-
if body = request.body_io
|
81
|
-
http_req.body_stream = body
|
82
|
-
end
|
83
|
-
|
84
|
-
http_req
|
85
|
-
end
|
86
|
-
|
87
|
-
def perform_request(http, request, res)
|
88
|
-
http.request(net_http_request(request)) do |http_res|
|
89
|
-
res.status_code = http_res.code.to_i
|
90
|
-
http_res.each_header do |key, value|
|
91
|
-
res.header[key] = value
|
92
|
-
end
|
93
|
-
|
94
|
-
if :get == request.verb
|
95
|
-
http_res.read_body { |chunk| res.receive_body(chunk) }
|
96
|
-
else
|
97
|
-
res.receive_body(http_res.body)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|